?
Solved

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

Posted on 2007-03-22
5
Medium Priority
?
280 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 2000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

741 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