Solved

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

Posted on 2007-03-22
5
268 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
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
Jon_Raymond earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now