Solved

Mechanism for matching (assigning) Job Applicants to Jobs - Three tables involved. ASP.NET 2.0, SQL, VB

Posted on 2007-03-22
5
279 Views
Last Modified: 2013-11-26
What's a good way to match Job Applicants TO Job Titles AT Work Sites?

I'm Using:  
SQL Server 2000, VS2005/VB.NET, .NET 2.0 to create a Windows Form application.

I Have: Three Tables;  
APPLICANTS (pkApplicantID, fkJobTitleID,fkWorksiteID,Name, City),
JOBTITLES (pkJobTitleID, fkWorksiteID, JobTitle, int_#OfPositions)
WORKSITES (pkWorksiteID, City)

I've tried:  
Three DataGridViews on the Windows Form, one for each Table so the user can see the Applicant's Name and (address) City, the list of Job Titles and how many Positions are available, and the Work Site (location) City.

And a ComboBox with the following databound settings:
Data Source: JobTitlesBindingSource
Display Member: JobTitle
Value Member: pkJobTitleID
Selected Value: ApplicantBindingSource - fkJobTitleID

What works:
I can scroll around in the Job Titles and click on an Applicant in the DataGridView and when I leave the row of the Applicant record the fkJobTitleID will update to the currently selected pkJobTitleID of the Job Title DataGridView.  

What doesn't work:
Save Data is not hooked up, so my updates are not written back to the database.  
I wasn't able to get the BindingNavigator to be automatically added to the form when I added the DataGridView like it was on the "Tab" below.

Something somewhere else that's related that works:
I have another set of DataGridViews for assigning a Job Coach or "Monitor" to a Worksite.  On that "Tab" I have the two DataGridVies, the ComboBox linking them on the keyMonitorID and a BindingNavigator with a "Save" button.  This works similarly to the other one.

My thoughts:
This is very cumbersome and I don't think it's a very good interface for what I'm trying to do, but I have no experience in this area and am just experimenting with methods.

What I'm trying to do:
Make a user interface to match a table full of Job Applicants to a table full of Jobs (in a table by Job Title and number of positions available for that title at a particular Worksite (a third table)).

My previous programming experience: A little HTML and very little VBA.

My deadline:  Monday (two days away)

Main questions:  
1.  Is there a better way to do this?
2.  Are there any examples available I could use to go by?

Thanks in advance for any suggestions and advice.  Some code samples wouldn't hurt either. ;-)
David
0
Comment
Question by:megnin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
Jon_Raymond earned 500 total points
ID: 18773450
Make a datagrid of the applicanst. Add a template field to the grind. Add a dropdown to the template field. Bind that dropdown to a list if Jobs/Job IDs. To bind you'll probably have to use the databind event of the grid and populate the dropdown there. it would be best to create an array or even an XML file of the job list data, and then use that as the source for the dropdown.
0
 
LVL 1

Author Comment

by:megnin
ID: 18774374
The largest table is the APPLICANTS table and it has only about 1700 records.  I'm just learning, so although I want to know the "best" way to do it, I'm under a short timeline, so for now I think the "easiest" way is what I need.
I wouldn't know where to begin to create an array or XML file of the job list data.  So if I can bind right to the table I think I'd rather do that right now.  Mostly due to my lack of more advanced experience and not enough time for this project to learn to do it right.

If any of the steps you outlined will not be evident to a beginner once I get started, could you point out details where I might get lost if I'm not familiar with the tools you mentioned?

Thanks for your help!
David

0
 
LVL 1

Author Comment

by:megnin
ID: 18775114
Okay.  I've looked and looked.  I give up.  How do you add a template field to the DataGridView?
I did mention that I'm using .NET 2.0, right?  You said "Make a datagrid"  Wasn't "datagrid" in .Net 1.0? In .Net 2.0 it's now a DataGridView and that's what I'm using.  I just assumed that was what you meant and was just calling it by the old name out of habbit.

I couldn't find anything in VS2005 in the control properties or the little arrow on the control it's self or via a Google search on how to add a template field, other than adding it programatically.

Thanks.
0
 
LVL 6

Expert Comment

by:Jon_Raymond
ID: 18935214
In case you still need it here is an example from ASP.Net 2, You can see ASP:Label controls in this grid. Just use a dropdown control in place of the label control. You probably have to loop trough the grid rows to populate each drop down.:

                            <asp:GridView ID="dgMain" runat="server" AutoGenerateColumns="False" DataKeyNames="Report_ID" CellPadding="1" ForeColor="#333333" GridLines="Vertical" Width="100%" AllowSorting="True" PageSize="50" BorderColor="Transparent" BorderStyle="Solid" BorderWidth="2px" RowHeaderColumn="report_ID" CssClass="label">
                                <Columns>
                                    <asp:BoundField DataField="report_ID" SortExpression="report_ID" HeaderText="Report_ID" >
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Type" SortExpression="Type">
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_dgType" runat="server" Text='<%# Bind("shorttype") %>' tooltip='<%# Bind("type") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>                            
                                    <asp:TemplateField HeaderText="Completed" SortExpression="Completiondate">
                                        <ItemStyle HorizontalAlign=Right VerticalAlign=Top Wrap=False />
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_dgCompleted" runat="server" Text='<%# Bind("cdate") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                        <ItemTemplate>
                                            <asp:LinkButton CssClass="button" PostBackUrl='<%# "input.aspx?rid=" & Eval("report_ID") %>' ID="hplEdit" runat="server" NavigateUrl='<%# "input.aspx?rid=" & Eval("report_ID") %>'
                                                Text="edit" ToolTip="Edit Report Properties / Upload Report Files"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>                            
                                    <asp:TemplateField HeaderText="Title" SortExpression="Title">
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top />
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hplTitle" runat="server" NavigateUrl='<%# "details.aspx?rid=" & Eval("report_ID") %>'
                                                Text='<%# Eval("Title") %>'></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <RowStyle BackColor="#F7F6F3" Font-Size="Small" ForeColor="#333333" />
                                <EditRowStyle BackColor="#999999" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle HorizontalAlign="Center" />
                                <HeaderStyle BackColor="White" Font-Bold="True" Font-Size="X-Small" ForeColor="DimGray" VerticalAlign="Middle" />
                                <AlternatingRowStyle BackColor="White" Font-Size="Small" ForeColor="#284775" />
                                <EmptyDataTemplate>
                                    <asp:Label ID="lbl_EmptyDataGrid" runat="server" CssClass="validation" Text="No Data Returned"></asp:Label>
                                </EmptyDataTemplate>
                            </asp:GridView>
0
 
LVL 6

Expert Comment

by:Jon_Raymond
ID: 18935221
Also, to update the dropdown in the grid you loop through the grid and find each drop down in each row and set the valeu. This code does it for checkboxes in an ASP.Net 1.1 datagrid. But, you would likely need something similar. Though I haven't tries this in 2.0:

                Dim iRow
                With users_grid
                    If SelectAll_chk.Checked Then
                        For iRow = 0 To .Items.Count - 1
                            .SelectedIndex = iRow
                            CType(.Items(iRow).Cells(1).Controls(0).FindControl("select_chk"), CheckBox).Checked() = True
                        Next
                        SelectAll_chk.Text = "Deselect All"
                    Else
                        For iRow = 0 To .Items.Count - 1
                            .SelectedIndex = iRow
                            CType(.Items(iRow).Cells(1).Controls(0).FindControl("select_chk"), CheckBox).Checked() = False
                        Next
                        SelectAll_chk.Text = "Select All"
                    End If
                End With
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question