Imports HireLogLibrary Imports System.Data.SqlClient Imports System.Data Imports System.Collections.Generic Imports System.IO Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports vCardLibrary.PIMExports Partial Class ContactManager Inherits System.Web.UI.Page Dim oCompDAO As New CompanyDAO Dim oLocDAO As New CompanyDAO.CompanyLocationDAO Dim oBillLocDAO As New CompanyDAO.CompanyBillingAddressDAO Dim oLocation As Company.CompanyLocation Dim oBillLoc As Company.CompanyBillingAddress Dim oComp As Company Dim oErr As New CustomErrors Dim iCompID As Integer Dim sRecruitingType As String Dim oCompContactDAO As New CompanyContactDAO Dim oCompContact As New CompanyContact Dim oOffice As New Office Dim oOfficeDAO As New OfficeDAO Dim iContactID As Integer Dim iCompanyID As Integer Dim oSetDisplay As New SetDisplay Dim oSetDAO As New HLSetDAO Dim oEmp As New Employee Dim oEmpDAO As New EmployeeDAO Dim iRecruitingTypeID As Integer Dim oTaskDAO As New TasksDAO Dim oWidgets As New Widgets Dim oWidgetsDAO As New WidgetDAO Dim oCand As New Candidate Dim oCandDAO As New CandidateDAO Dim oReferralDAO As New ReferralDAO Dim connSql As SqlClient.SqlConnection = New SqlClient.SqlConnection(ConfigurationSettings.GetConfig("DSAppSettings")("sqlconnString")) Public Property companyID() As Integer Get Return iCompID End Get Set(ByVal value As Integer) iCompID = value End Set End Property Public Property contactID() As Integer Get Return iContactID End Get Set(ByVal value As Integer) iContactID = value End Set End Property Public Property recruitingType() As String Get Return sRecruitingType End Get Set(ByVal value As String) sRecruitingType = value End Set End Property Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad Page.Title = Session("AppName") & " - Contact Manager" Session("CRM") = True End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Len(Session("LoggedInUser")) = 0 Then Response.Redirect(Constants.sURLPrefix & "/Login.aspx?url=ContactManager") End If If Not Session("IsAcctManager") Then accordian5.Style.Add("Display", "None") accordian2.Style.Add("Display", "None") 'Response.Redirect("NoAccess.aspx") End If If Len(Request.QueryString("compid")) > 0 And IsNumeric(Request.QueryString("compid")) Then companyID = Request.QueryString("compid") Dim oEmpDAO As New EmployeeDAO Dim aCompList As New ArrayList aCompList = oEmpDAO.RetrieveEmployeeCompanies(Session("LoggedInUserID")) If Not aCompList.Contains(companyID) And Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then 'Server.Transfer("NoAccess.aspx") End If Else companyID = 0 End If hvEmpID.Value = Session("LoggedInUserID") 'Session("CanProspect") = False 'displays divs depending on url If Request.Url.ToString.Contains("compid=" & Request.QueryString("compid")) Then Navigator.Text = "Company » All Company » Company/Company Contacts" divCompaniesInfo.Style.Add("Display", "Block") divCompanies.Style.Add("Display", "Block") divCompanies.Style.Add("Width", "185px") divCompanies.Style.Add("Height", "543px") divCompaniesContact.Style.Add("Display", "Block") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") Textbox1.Attributes.Add("onblur", "WaterMark(this, event);") Textbox1.Attributes.Add("onfocus", "WaterMark(this, event);") CompTask() CompProspects() PopulateCompanyInfo() End If If Request.Url.ToString.Contains("compid=" & Request.QueryString("compid") & "&contactid=" & Request.QueryString("contactid")) Then Navigator.Text = "Company" divCompaniesInfo.Style.Add("Display", "Block") divCompanies.Style.Add("Display", "Block") divCompaniesContact.Style.Add("Display", "Block") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") td1.Style.Add("Display", "None") If Not IsPostBack Then divTask.Style.Add("Display", "None") End If popup.Show() Else If Request.Url.ToString.Contains("contactid=" & Request.QueryString("contactid")) Then Navigator.Text = "Contacts » All Contacts" AllContacts.Style.Add("Display", "Block") AllContacts.Style.Add("width", "770px") AllContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") If Not IsPostBack Then divTask.Style.Add("Display", "None") End If popup.Show() If PermissionCheck.EmployeeIsAdmin(Session("LoggedInUserType")) Or Session("CanViewFinancial") Then pnlExpenses.Visible = True End If End If If Request.Url.ToString.Contains("ProspectContactid=" & Request.QueryString("contactid")) Then Navigator.Text = "Contacts » All Prospect Contacts" ViewProspects.Style.Add("Display", "Block") ViewProspects.Style.Add("width", "770px") ViewProspects.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") If Not IsPostBack Then divTask.Style.Add("Display", "None") End If popup.Show() End If If Request.Url.ToString.Contains("ProspectCandidateid=" & Request.QueryString("Candidateid")) Then Navigator.Text = "Prospect Candidates » All Prospect Candidates" AllCandidatesProspects.Style.Add("Display", "Block") AllCandidatesProspects.Style.Add("width", "770px") AllCandidatesProspects.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") If Not Page.IsPostBack Then ProspectCandidate() popupCandidate.Show() End If End If End If If Request.Url.ToString.Contains("compID=" & ddCompanyAddContacts.SelectedValue) Then Navigator.Text = "Contacts » Add/Update Contacts" AddContacts.Style.Add("Display", "Block") AddContacts.Style.Add("width", "770px") AddContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") End If If Request.Url.ToString.Contains("companyid=") Then Navigator.Text = "Contacts » Add/Update Contacts" AddContacts.Style.Add("Display", "Block") AddContacts.Style.Add("width", "770px") AddContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllContacts.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") popup.Hide() lbChooseCompany.Visible = False ddCompanyAddContacts.Visible = False End If If Request.Url.ToString.Contains("compIDSearch=") Then Navigator.Text = "Company » Advanced Search" SearchContacts.Style.Add("Display", "Block") SearchContacts.Style.Add("width", "770px") SearchContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") 'If Not IsPostBack Then 'PopulateCompanyInfo() 'CompanyInfoPopup.Show() 'End If End If If Request.Url.ToString.Contains("contactIDSearch=") Then Navigator.Text = "Contact » Advanced Search" SearchContacts.Style.Add("Display", "Block") SearchContacts.Style.Add("width", "770px") SearchContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") 'ContactInfo() If Not IsPostBack Then divTask.Style.Add("Display", "None") End If 'popup.Show() End If If Request.Url.ToString.Contains("Search") Then Navigator.Text = "Advanced Search" SearchContacts.Style.Add("Display", "Block") SearchContacts.Style.Add("width", "770px") SearchContacts.Style.Add("height", "543px") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") End If If Request.Url.ToString.Contains("locationid=") Then AddCompanies.Style.Add("Display", "Block") AddCompanies.Style.Add("width", "770px") AddCompanies.Style.Add("height", "543px") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") End If If Request.Url.ToString.Contains("timemgtid=") Then AddCompanies.Style.Add("Display", "Block") AddCompanies.Style.Add("width", "770px") AddCompanies.Style.Add("height", "543px") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") End If If Request.Url.ToString.Contains("AddCompany") Then Navigator.Text = "Company » Add/Update Company" AddCompanies.Style.Add("Display", "Block") AddCompanies.Style.Add("width", "770px") AddCompanies.Style.Add("height", "543px") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") End If If Request.Url.ToString.Contains("AddContact") Then Navigator.Text = "Contact » Add/Update Contact" AddContacts.Style.Add("Display", "Block") AddContacts.Style.Add("width", "770px") AddContacts.Style.Add("height", "543px") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") TaskDashboarddiv.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") td1.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") ddCompanyAddContacts.Items.FindByValue(Request.QueryString("compid")) End If If Request.Url.ToString.Contains("Dashboard") Then Navigator.Text = "Dashboard" AddContacts.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") TaskDashboarddiv.Style.Add("Display", "Block") CandidateProsDashboard.Style.Add("Display", "Block") ProspectsDashboard.Style.Add("Display", "Block") RecentlyAddedContacts.Style.Add("Display", "Block") RecentlyAddedCompanies.Style.Add("Display", "Block") RemindersDashBoard.Style.Add("Display", "Block") AllCandidatesProspects.Style.Add("Display", "None") ClassicView.Style.Add("display", "none") td1.Style.Add("Display", "Block") End If If Request.Url.ToString.Contains("Dashcandid") Then Navigator.Text = "Dashboard" AddContacts.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") TaskDashboarddiv.Style.Add("Display", "Block") CandidateProsDashboard.Style.Add("Display", "Block") ProspectsDashboard.Style.Add("Display", "Block") RecentlyAddedContacts.Style.Add("Display", "Block") RecentlyAddedCompanies.Style.Add("Display", "Block") RemindersDashBoard.Style.Add("Display", "Block") AllCandidatesProspects.Style.Add("Display", "None") ClassicView.Style.Add("display", "none") td1.Style.Add("Display", "Block") End If If Request.Url.ToString.Contains("candid") Then If Not Page.IsPostBack Then ProspectCandidate() popupCandidate.Show() End If End If If Request.Url.ToString.Contains("WeekContid") Then If Not IsPostBack Then divTask.Style.Add("Display", "None") End If popup.Show() End If If Request.Url.ToString.Contains("RecentContid") Then If Not IsPostBack Then divTask.Style.Add("Display", "None") End If If PermissionCheck.EmployeeIsAdmin(Session("LoggedInUserType")) Or Session("CanViewFinancial") Then pnlExpenses.Visible = True End If popup.Show() End If 'bind all grids BindAllCandidateProspectsGrid() AddUpdateCompany() ContactInfo() PopulateAddContacts() Search() RecentContactsDashBoard() RecentCompaniesDashBoard() RecentCandidatesDashBoard() ReminderDashBoard() ProspectDashBoard() CandidateProspectDashBoard() BindAllCandidateGrid() PopulateColorDropDownMain() 'populate company by employee id rptLinks.DataSource = oCompDAO.PopulateCompany(iEmployeeIDIn:=Session("LoggedInUserID")) rptLinks.DataBind() BindContactGrid() BindAllContactGrid() BindAllProspectsGrid() BindJOGridContacts() BindHireGrid() BindInterviewGrid() Dim oExpDAO As New ExpensesDAO With dgExpenses .DataSource = oExpDAO.RetrieveExpensesByContactID(Session("contactId")) .DataBind() End With If Request.Url.ToString.Contains("AddContact&compid") Then ddCompanyAddContacts.SelectedValue = Request.QueryString("compid") End If If Not Page.IsPostBack Then Dim oWidgets = New Widgets oWidgets = oWidgetsDAO.RetrieveWidgets(oEmployeeIDIn:=Session("LoggedInUserID")) If oWidgets.iWidgetID > 0 Then lnkCreateWidgets.Visible = False End If End If 'Detects browser firefox and IE If Request.Browser.Browser = "IE" Then Body.Style.Add("overflow", "hidden") End If 'color scheme If Not Page.IsPostBack Then If Not Request.Cookies("bgColor") Is Nothing Then Body.Style("background-color") = "#" + Request.Cookies("bgColor").Value txtBGcolor.Text = Request.Cookies("bgColor").Value Else Response.Cookies("bgColor").Value = "" End If If Not Request.Cookies("eHirePowerBGcolor") Is Nothing Then txtHeaderBG.Text = Request.Cookies("eHirePowerBGcolor").Value Response.Cookies("eHirePowerBGcolor").Value = txtHeaderBG.Text Else Response.Cookies("eHirePowerBGcolor").Value = "F0F0F0" End If If Not Request.Cookies("NavHeaderColor") Is Nothing Then accordian1.Style("background-color") = "#" + Request.Cookies("NavHeaderColor").Value accordian2.Style("background-color") = "#" + Request.Cookies("NavHeaderColor").Value accordian3.Style("background-color") = "#" + Request.Cookies("NavHeaderColor").Value accordian4.Style("background-color") = "#" + Request.Cookies("NavHeaderColor").Value accordian5.Style("background-color") = "#" + Request.Cookies("NavHeaderColor").Value txtHeadBack.Text = Request.Cookies("NavHeaderColor").Value Else Response.Cookies("NavHeaderColor").Value = "" End If If Not Request.Cookies("NavBackColor") Is Nothing Then ul.Style("background-color") = "#" + Request.Cookies("NavBackColor").Value txtNavBackColor.Text = Request.Cookies("NavBackColor").Value Else Response.Cookies("NavBackColor").Value = "" End If If Not Request.Cookies("NavTextColor") Is Nothing Then ul.Style("color") = "#" + Request.Cookies("NavTextColor").Value lnkResetDash.Style("color") = "#" + Request.Cookies("NavTextColor").Value NavigatorDiv.Style("color") = "#" + Request.Cookies("NavTextColor").Value txtNavTextColor.Text = Request.Cookies("NavTextColor").Value Else Response.Cookies("NavTextColor").Value = "" End If If Not Request.Cookies("MainHeaderColor") Is Nothing Then Div1.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div2.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div3.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div4.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div5.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div6.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div7.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div8.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div9.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div10.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div11.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div12.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div13.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div14.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div15.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div16.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div17.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div18.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div19.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value Div20.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value popupNavDiv.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value popupNavDiv2.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value tabcontainer.Style("background-color") = "#" + Request.Cookies("MainHeaderColor").Value txtMainHeaderColor.Text = Request.Cookies("MainHeaderColor").Value Else Response.Cookies("MainHeaderColor").Value = "F0F0F0" End If If Not Request.Cookies("MainHeaderText") Is Nothing Then Div1.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div2.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div3.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div4.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div5.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div6.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div7.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div8.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div9.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div10.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div11.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div12.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div13.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div14.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div15.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div16.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div17.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div18.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div19.Style("color") = "#" + Request.Cookies("MainHeaderText").Value Div20.Style("color") = "#" + Request.Cookies("MainHeaderText").Value popupNavDiv.Style("color") = "#" + Request.Cookies("MainHeaderText").Value popupNavDiv2.Style("color") = "#" + Request.Cookies("MainHeaderText").Value txtMainHeaderText.Text = Request.Cookies("MainHeaderText").Value Else Response.Cookies("MainHeaderText").Value = "" End If If Not Request.Cookies("MainSubheader") Is Nothing Then dgRecentCompanies.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgRecentContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) 'dgReminder.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgTask.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgCandidates.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgCandidatesProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgDashCanPros.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgJO.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgProspectDashBoard.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgSearchResults.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgAllContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgAllProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) dgCompProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) gvCompTask.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) 'dgContracts.HeaderStyle.BackColor = System.Drawing.Color.FromName(Request.Cookies("MainSubheader").Value) ddMainColors.SelectedItem.Text = Request.Cookies("MainSubheader").Value Else ddMainColors.SelectedItem.Text = "Silver" Response.Cookies("MainSubheader").Value = "" End If Request.Cookies("MainSubheader").Value = ddMainColors.SelectedItem.Text If Not Request.Cookies("MainBackColor") Is Nothing Then TaskDashboarddiv.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value CandidateProsDashboard.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value ProspectsDashboard.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value RecentlyAddedContacts.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value RecentlyAddedCompanies.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value RemindersDashBoard.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value ColorScheme.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AllContacts.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value ViewProspects.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value ViewAllCandidates.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AllCandidatesProspects.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddContacts.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value SearchContacts.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddCanRes.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddCanMan.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddCanPros.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value CanSets.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AdvancedCanSearch.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value ViewJO.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddNewJO.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value JOSets.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value JOSearch.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value AddCompanies.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value divCompanies.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value divCompaniesInfo.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value divCompaniesContact.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value containerfotTab.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value tab1.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value tab2.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value tab3.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value tab4.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value pnlAddEdit.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value pnlAddEdit2.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value pnlAddEdit4.Style("background-color") = "#" + Request.Cookies("MainBackColor").Value txtMainBack.Text = Request.Cookies("MainBackColor").Value Else Response.Cookies("MainBackColor").Value = "FFFFFF" End If End If End Sub Public Sub CompanyInfo() hdnRecruitingTypeID.Value = Session("RecruitingTypeID") If Session("RecruitingType") = "Institutional" Then DisplaySchoolProperties() End If If Not Page.IsPostBack Then With ddClassifications .DataSource = oCompDAO.PopulateClassification(hdnRecruitingTypeID.Value) .DataValueField = "ClassificationID" .DataTextField = "ClassificationName" .DataBind() End With With lstTimeMgt .DataSource = oCompDAO.PopulateTimeMgt .DataValueField = "TimeMgtID" .DataTextField = "SystemName" .DataBind() End With With ddSource .DataSource = oCompDAO.PopulateCompanySource .DataValueField = "CompanySourceID" .DataTextField = "SourceName" .DataBind() .Items.Insert(0, "-- Select --") End With Dim oCons As New ConsultantDAO With chkHireTypes .DataSource = oCons.PopulateHireTypes(True) .DataValueField = "HireTypeID" .DataTextField = "HireTypeName" .DataBind() End With If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then ddActive.Enabled = False End If If companyID > 0 Then oComp = New Company If Session("RecruitingType") = "Institutional" Then DisplaySchoolProperties() recruitingType = oComp.sRecruitingType End If oComp = oCompDAO.RetrieveCompany(companyID) hdnRecruitingTypeID.Value = oComp.iRecruitingTypeID txtCompanyName.Text = oComp.sCompanyName txtCompanyPhone.Text = oComp.sMainPhone txtDescription.Text = Utilities.RemoveBreaks(oComp.sDescription) txtBenefits.Text = Utilities.RemoveBreaks(oComp.sBenefits) hdnBenefitsFile.Value = oComp.sBenefitsFile txtWebsite.Text = oComp.sWebsite hdnCompanyID.Value = oComp.iCompanyID ddClassifications.SelectedValue = oComp.iClassificationID ddSource.SelectedValue = oComp.iCompanySourceID If Not oComp.aHireTypes Is Nothing Then For Each ht As Integer In oComp.aHireTypes chkHireTypes.Items.FindByValue(ht).Selected = True Next End If ddActive.SelectedValue = CInt(oComp.blnActive) Dim oContractsDAO As New ContractsDAO With rptLocationList .DataSource = oLocDAO.PopulateLocationAddress(companyID, True) .DataBind() End With With rptTimeMgt .DataSource = oCompDAO.PopulateTimeMgt(companyID) .DataBind() End With ' If location was passed in, populate location fields If Len(Request.QueryString("locationid")) > 0 Then If Request.QueryString("billing") = 0 Then oLocation = New Company.CompanyLocation oLocation = oLocDAO.RetrieveCompanyLocation(Request.QueryString("locationid")) With oLocation txtNewAddr.Text = .sAddress txtNewCity.Text = .sCity txtNewState.Text = .sState txtNewZip.Text = .sZip hdnLocationID.Value = .iLocationID chkBillingAddr.Checked = False chkHeadquarters.Checked = .blnIsHeadquarters hdnBilling.Value = 0 End With Else oBillLoc = New Company.CompanyBillingAddress oBillLoc = oBillLocDAO.RetrieveBillingAddress(Request.QueryString("locationid")) With oBillLoc txtNewAddr.Text = .sAddress txtNewCity.Text = .sCity txtNewState.Text = .sState txtNewZip.Text = .sZip hdnLocationID.Value = .iBillingAddressID chkBillingAddr.Checked = True chkHeadquarters.Checked = False hdnBilling.Value = 1 End With End If btnSubmitAddress.Visible = True btnDelete.Visible = True btnCancel.Visible = True lblLocation.Text = "Update Location" End If If Len(Request.QueryString("timemgtid")) > 0 Then oCompDAO.DeleteTimeMgtByTimeMgtID(Request.QueryString("timemgtid")) Server.Transfer("AddCompany.aspx?compid=" & companyID) End If If Len(Request.QueryString("contractid")) > 0 Then If PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then oContractsDAO.DeleteContract(Request.QueryString("contractid")) Server.Transfer("AddCompany.aspx?compid=" & companyID) Else Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "Contracts can only be deleted by a manager or administrator", Utilities.MessageLabel.WARNING) End If End If Else ddActive.Enabled = False End If End If End Sub Public Sub BindContactGrid() Dim oCompContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.GetContactsByCompanyID(Request.QueryString("compid"), iEmployeeIDIn:=Session("LoggedInUserID")) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgContacts .DataSource = dv .DataBind() End With dr.Close() End Sub Protected Sub View(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Session("contactId") = dgContacts.DataKeys(e.Item.ItemIndex) Response.Redirect("ContactManager.aspx?compid=" & Request.QueryString("compid") & "&contactid=" & Session("contactId")) popup.Show() CompanyInfoPopup.Hide() End Sub Public Sub BindAllContactGrid() Dim oCompContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.RetrieveEmployeeContacts(iEmployeeIDIn:=Session("LoggedInUserID"), blnProspectIn:=False) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgAllContacts .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub CompTask() Dim aTaskList As New List(Of HireLogLibrary.Tasks) Dim dtTasks As New DataTable Dim taskRow As DataRow aTaskList = New List(Of HireLogLibrary.Tasks) aTaskList = oTaskDAO.RetrieveTasksByCompanyID(Request.QueryString("compid")) dtTasks = New DataTable dtTasks.Columns.Add("CompanyContactID", GetType(Integer)) dtTasks.Columns.Add("TaskNotes", GetType(String)) dtTasks.Columns.Add("TaskCreatedDate", GetType(String)) For Each oTask As HireLogLibrary.Tasks In aTaskList taskRow = dtTasks.NewRow taskRow("CompanyContactID") = oTask.iCompanyContactID taskRow("TaskNotes") = oTask.sTaskNotes taskRow("TaskCreatedDate") = oTask.dtTaskDate dtTasks.Rows.Add(taskRow) Next With gvCompTask .DataSource = dtTasks .DataBind() End With End Sub 'Protected Sub lnkTaskView_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Dim row As GridViewRow = CType(CType(sender, LinkButton).Parent.Parent, GridViewRow) ' Session("contactId") = row.Cells(3).Text 'ClientScript.RegisterStartupScript(Me.GetType(), "OpenWindow", "window.open('ContactDetails.aspx?contactid=" & Session("Contactid") & "', '', 'location=0,menubar=0,resizable=1,width=800,height=400,left=100,top=200,scrollbars=1');", True) 'Response.Redirect("ContactManager.aspx?compid=" & Request.QueryString("compid") & "&contactid=" & Session("contactId") & "#fragment-14") 'popup.Show() ' CompanyInfoPopup.Hide() 'End Sub Public Sub CompProspects() Dim oCompContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.GetContactsByCompanyID(Request.QueryString("compid"), iEmployeeIDIn:=Session("LoggedInUserID"), blnProspectIn:=True) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgCompProspects .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub BindAllProspectsGrid() Dim oCompContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.RetrieveEmployeeContacts(iEmployeeIDIn:=Session("LoggedInUserID"), blnProspectIn:=True) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgAllProspects .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub BindAllCandidateGrid() Dim oCanDAO As New CandidateDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCanDAO.RetrieveCandidatesByEmployeeID(iEmployeeIDIn:=Session("LoggedInUserID"), blnShowProspects:=False) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "FirstName" With dgCandidates .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub BindAllCandidateProspectsGrid() Dim oCanDAO As New CandidateDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCanDAO.RetrieveCandidateProspectinReader(iEmployeeIDIn:=Session("LoggedInUserID")) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "FirstName" With dgCandidatesProspects .DataSource = dv .DataBind() End With dr.Close() End Sub Private Sub dgAllContacts_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgAllContacts.PageIndexChanged dgAllContacts.CurrentPageIndex = e.NewPageIndex BindAllContactGrid() AllContacts.Style.Add("Display", "block") AllContacts.Style.Add("width", "auto") AllContacts.Style.Add("height", "543px") ViewAllCandidates.Style.Add("Display", "None") SearchContacts.Style.Add("Display", "none") TaskDashboarddiv.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") td1.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") End Sub Private Sub dgCandidates_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgCandidates.PageIndexChanged dgCandidates.CurrentPageIndex = e.NewPageIndex BindAllCandidateGrid() ViewAllCandidates.Style.Add("Display", "Block") ViewAllCandidates.Style.Add("width", "auto") ViewAllCandidates.Style.Add("height", "543px") SearchContacts.Style.Add("Display", "none") TaskDashboarddiv.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") CandidateProsDashboard.Style.Add("Display", "None") ProspectsDashboard.Style.Add("Display", "None") RecentlyAddedContacts.Style.Add("Display", "None") RecentlyAddedCompanies.Style.Add("Display", "None") RemindersDashBoard.Style.Add("Display", "None") td1.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") AllContacts.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") ClassicView.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") End Sub Private Sub DisplaySchoolProperties() 'lblTypeIndicator.Text = "SCHOOL" Page.Title = Session("AppName") & " - Add/Modify School" lblDescription.Visible = False lblBenefits.Visible = False txtDescription.Visible = False txtBenefits.Visible = False lblUpload.Visible = False fileBenefits.Visible = False chkHeadquarters.Text = "Headquarters Address" chkBillingAddr.Visible = False pnlCompanyInfo.Visible = False End Sub Private Sub ContactInfo() oCompContact = New CompanyContact oCompContact = oCompContactDAO.RetrieveCompanyContact(Session("contactId")) If Request.Url.ToString.Contains("contactIDSearch") Then Session("contactId") = Request.QueryString("contactIDSearch") ElseIf Request.Url.ToString.Contains("RecentContid") Then oCompContact = oCompContactDAO.RetrieveCompanyContact(Request.QueryString("RecentContid")) End If Session("UpdateContact") = Request.QueryString("companyid") companyID = oCompContact.iCompanyID task.typeName = oCompContact.sFullName task.typeId = oCompContact.iCompanyContactID task.taskType = "Contact" existingTask.typeId = oCompContact.iCompanyContactID existingTask.taskType = "Contact" lblContactName.Text = oCompContact.sFullName lblEdit.Text = "Edit" lblCompany.Text = "" & oCompContact.sCompanyName & "" lblTitle.Text = oCompContact.sTitle lblMainContact.Text = oCompContact.sDayPhone lblEmail.Text = "" & oCompContact.sEmail & "" lblContact2.Text = oCompContact.sMobilePhone lblFax.Text = oCompContact.sFax lblEmail2.Text = "" & oCompContact.sEmail2 & "" lblEmail3.Text = "" lblNotes.Text = oCompContact.sNotes Dim oEmpList As New System.Collections.Generic.List(Of Employee) Dim sContactList As String = "" oEmpList = oCompContactDAO.RetrieveEmployeesAssignedTo(contactID) For Each oEmp As Employee In oEmpList sContactList &= oEmp.sFullName & "
" Next lblAssignedTo.Text = sContactList lblReferral.Text = oCompContact.sReferrer If oCompContact.dtDateModified = "1/1/1900" Then lblContactUpdated.Text = oCompContact.dtDateEntered Else lblContactUpdated.Text = oCompContact.dtDateModified End If lblUpdatedBy.Text = oCompContact.sModifier lblIsProspect.Text = Utilities.TFToYN(oCompContact.blnIsProspect) lblActive.Text = Utilities.TFToYN(oCompContact.blnActive) lbActivePopulateCOmpInfo.Text = Utilities.TFToYN(oCompContact.blnActive) If oCompContact.blnActive = False Then lblActive.ForeColor = Color.Red lblActive.Font.Bold = True End If imgEdit.Visible = True lblEdit.Visible = True imgVCard.Visible = True lnkVCard.Visible = True imgTask.Visible = True btnTask.Visible = True oSetDisplay.GenerateSetTable("CompanyContact", tblCCSetList, Session("LoggedInUserID"), "Contact Sets", Request.QueryString("contactid")) End Sub Protected Sub lnkVCard_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkVCard.Click ExportToVCard(iContactIDIn:=Session("contactId")) End Sub Protected Sub btnTask_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTask.Click If IsPostBack Then divTask.Style.Add("Display", "Block") End If pnlTask.Visible = True btnExitTask.Visible = True End Sub Protected Sub btnExitTask_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExitTask.Click pnlTask.Visible = False btnExitTask.Visible = False End Sub Protected Sub btnSets_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSet.Click divSelectSets.Style.Add("Display", "Block") End Sub Protected Sub btnCloseSets_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCloseSet.Click divSelectSets.Style.Add("Display", "None") End Sub Private Sub ExportToVCard(ByVal iContactIDIn As Integer) ' Export to vCard file Dim oVCard As New vCard oCompContact = New CompanyContact oCompContact = oCompContactDAO.RetrieveCompanyContact(iContactIDIn) Dim sFName As String = oCompContact.sFirstName Dim sLName As String = oCompContact.sLastName oVCard.FirstName = sFName oVCard.LastName = sLName oVCard.JobTitle = oCompContact.sTitle oVCard.FormattedName = sFName & " " & sLName oVCard.Organization = oCompContact.sCompanyName ' Add primary phone number (work number) Dim phone1 As New vCard.vTelephone(oCompContact.sDayPhone) phone1.Location = vCard.vLocations.WORK phone1.Type = vCard.vPhoneTypes.VOICE oVCard.Telephones.Add(phone1) ' Add secondary phone number If Len(oCompContact.sMobilePhone) > 0 Then Dim phone2 As New vCard.vTelephone(oCompContact.sMobilePhone) phone2.Location = vCard.vLocations.CELL oVCard.Telephones.Add(phone2) End If If Len(oCompContact.sEveningPhone) > 0 Then Dim phone3 As New vCard.vTelephone(oCompContact.sEveningPhone) phone3.Location = vCard.vLocations.HOME oVCard.Telephones.Add(phone3) End If If Len(oCompContact.sFax) > 0 Then Dim fax As New vCard.vTelephone(oCompContact.sFax) fax.Location = vCard.vLocations.WORK fax.Type = vCard.vPhoneTypes.FAX oVCard.Telephones.Add(fax) End If Dim email As New vCard.vEmail(oCompContact.sEmail) email.Preferred = True oVCard.Emails.Add(email) If Len(oCompContact.sEmail2) > 0 Then Dim email2 As New vCard.vEmail(oCompContact.sEmail2) email2.Preferred = False oVCard.Emails.Add(email2) End If Response.AddHeader("content-disposition", "attachment;filename=" & sFName & "_" & sLName & ".vcf") Response.ContentType = "text/x-vcard" Response.Write(oVCard.ToString) Response.End() End Sub Protected Sub btnSubmitSet_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitSet.Click Dim oSet As HLSet Dim aIDs As Array Dim sb As New StringBuilder Try If Len(txtNewSet.Text) > 0 Then 'Add New Set oSet = New HLSet With oSet .sSetName = txtNewSet.Text .sSetType = "CompanyContact" .iEmployeeID = Session("LoggedInUserID") End With Dim aList As New List(Of Integer) aList.Add(Request.QueryString("contactid")) Dim iNewID As Integer = oSetDAO.InsertUpdateSet(0, oSet, aList) oSet = New HLSet oSet = oSetDAO.GetSetBySetID(iNewID) sb.Append("Contact added to set: " & oSet.sSetName & "
") Else aIDs = Split(Request.Form("chkID").Trim, ",") For ids As Integer = LBound(aIDs) To UBound(aIDs) oSet = New HLSet oSet = oSetDAO.GetSetBySetID(aIDs(ids)) If oSetDAO.InsertEntity(Request.QueryString("contactid"), aIDs(ids)) = 1 Then sb.Append("Contact added to set: " & oSet.sSetName & "
") Else sb.Append("Contact already exists in set: " & oSet.sSetName & "
") End If Next End If oSetDisplay = New SetDisplay oSetDisplay.GenerateSetTable("CompanyContact", tblCCSetList, Session("LoggedInUserID"), "Contact Sets", Request.QueryString("contactid")) Utilities.MessageLabel.DisplayMessageLabel(infoLabel, sb.ToString, Utilities.MessageLabel.CONFIRM) Catch ex As Exception oErr.WriteError(ex, Session("LoggedInUserID")) Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "Addition to set failed", Utilities.MessageLabel.WARNING) End Try End Sub Private Sub PopulateAddContacts() Dim oEmpDAO As New EmployeeDAO Dim aCompList As New ArrayList aCompList = oEmpDAO.RetrieveEmployeeCompanies(Session("LoggedInUserID")) If Not aCompList.Contains(companyID) And Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then If Len(Request.QueryString("contactid")) > 0 Then 'Server.Transfer("NoAccess.aspx") End If End If If Len(Request.QueryString("contactid")) > 0 And IsNumeric(Request.QueryString("contactid")) Then contactID = Request.QueryString("contactid") hdnContactID.Value = contactID Else contactID = 0 hdnContactID.Value = 0 End If If Not Page.IsPostBack Then ddCompanyAddContacts.SelectedValue = Session("onCompanyChange") With ddCompanyAddContacts .DataSource = oCompDAO.PopulateCompany(iEmployeeIDIn:=Session("LoggedInUserID")) .DataValueField = "CompanyID" .DataTextField = "CompanyName" .DataBind() .Items.Insert(0, New ListItem("-- Select --", 0)) End With Dim oContractsDAO As New ContractsDAO With ddContracts .DataSource = oContractsDAO.RetrieveContractInfo(companyID) .DataValueField = "ContractID" .DataTextField = "ContractName" .DataBind() .Items.Insert(0, New ListItem("-- Select --", 0)) .SelectedIndex = 0 End With Dim empReader As XmlDataSource = New XmlDataSource empReader.DataFile = Constants.sXMLRoot & "acctmgrs.xml" If Session("VendorID") > 0 Then empReader.XPath = "//Employee[@VendorID=" & Session("VendorID") & "]" End If With lstAssignedTo .DataSource = empReader .DataTextField = "EmployeeName" .DataValueField = "EmployeeID" .DataBind() .SelectedIndex = -1 End With empReader = New XmlDataSource empReader.DataFile = Constants.sXMLRoot & "employees.xml" If Session("VendorID") > 0 Then empReader.XPath = "//Employee[@VendorID=" & Session("VendorID") & "]" End If With ddReferral .DataSource = empReader .DataTextField = "EmployeeName" .DataValueField = "EmployeeID" .DataBind() .Items.Insert(0, New ListItem("-- Select --", 0)) .SelectedIndex = 0 End With If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then lstAssignedTo.Enabled = False ddContracts.Enabled = False End If If oCompContact.blnIsProspect = True Then ddIsProspect.SelectedValue = True Else ddIsProspect.SelectedValue = False End If If Session("RecruitingType") = "Institutional" Then ddIsProspect.Visible = False lbIsProspect.Visible = False ddReferral.Enabled = False End If If contactID > 0 Then ' Retrieve existing contact oCompContact = New CompanyContact oCompContact = oCompContactDAO.RetrieveCompanyContact(contactID) txtFirstName.Text = oCompContact.sFirstName txtLastName.Text = oCompContact.sLastName txtEmail.Text = oCompContact.sEmail txtEmail2.Text = oCompContact.sEmail2 txtMainPhone.Text = oCompContact.sDayPhone txtMobilePhone.Text = oCompContact.sMobilePhone txtPhone3.Text = oCompContact.sEveningPhone txtFax.Text = oCompContact.sFax txtTitle.Text = oCompContact.sTitle txtNotes.Text = oCompContact.sNotes ddIsProspect.SelectedValue = Utilities.TFToYN(oCompContact.blnIsProspect) ddActiveAddContact.SelectedValue = CInt(oCompContact.blnActive) If oCompContact.iReferrer > 0 Then If Not ddReferral.Items.FindByValue(oCompContact.iReferrer) Is Nothing Then ddReferral.SelectedValue = oCompContact.iReferrer End If ddReferral.SelectedValue = oCompContact.iReferrer Else ddReferral.SelectedIndex = 0 End If If Not ddContracts.Items.FindByValue(oCompContact.iContractID) Is Nothing Then ddContracts.SelectedValue = oCompContact.iContractID End If ' Retrieve assignees Dim oEmpList As New System.Collections.Generic.List(Of Employee) oEmpList = oCompContactDAO.RetrieveEmployeesAssignedTo(contactID) For Each oEmp As Employee In oEmpList If Not lstAssignedTo.Items.FindByValue(oEmp.iEmployeeID) Is Nothing Then lstAssignedTo.Items.FindByValue(oEmp.iEmployeeID).Selected = True End If Next End If End If End Sub Protected Sub btnSubmitContact_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitContact.Click If ddCompanyAddContacts.SelectedValue = 0 Then ClientScript.RegisterStartupScript(Me.GetType(), "alertacomp", "alert('Please select a company.');", True) Else oCompContact = New CompanyContact oComp = New Company ' Insert new company information into database Dim iNewContactID As Integer Dim iInsUpd As Integer If Request.Url.ToString.Contains("companyid") Then hdnCompanyID2.Value = Request.QueryString("companyid") Else hdnCompanyID2.Value = Request.QueryString("compid") End If Try If hdnContactID.Value = 0 Then ' Insert new contact iInsUpd = 0 Else iInsUpd = 1 End If ' Insert/Update With oCompContact .iCompanyContactID = hdnContactID.Value .iCompanyID = hdnCompanyID2.Value .sFirstName = txtFirstName.Text .sLastName = txtLastName.Text .sTitle = txtTitle.Text .sEmail = txtEmail.Text .sEmail2 = txtEmail2.Text .sPhone = txtMainPhone.Text .sMobilePhone = txtMobilePhone.Text .sDayPhone = txtPhone3.Text .sFax = txtFax.Text .iModifierID = Session("LoggedInUserID") .iReferrer = ddReferral.SelectedItem.Value .sNotes = txtNotes.Text .iContractID = ddContracts.SelectedItem.Value .blnActive = ddActiveAddContact.SelectedItem.Value .blnIsProspect = ddIsProspect.SelectedItem.Value End With iNewContactID = _ oCompContactDAO.InsertUpdateCompanyContact(iInsUpd, oCCIn:=oCompContact) If iNewContactID = -1 Then Page.ClientScript.RegisterStartupScript(Me.GetType(), Guid.NewGuid().ToString(), "alert('This is a duplicate contact.');", True) End If If iNewContactID = 0 Then Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "0 was returned as ID. Insert or update of company failed.", Utilities.MessageLabel.WARNING) Exit Try Exit Sub Else If PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then If iInsUpd = 1 Then oCompContactDAO.DeleteContactAssignees(iNewContactID, hdnCompanyID2.Value) End If For Each assignedto As ListItem In lstAssignedTo.Items If assignedto.Selected Then oCompContactDAO.InsertContactAssignees(assignedto.Value, iNewContactID, hdnCompanyID2.Value) End If Next Else If iInsUpd = 0 Then oCompContactDAO.InsertContactAssignees(Session("LoggedInUserID"), iNewContactID, hdnCompanyID2.Value) End If End If End If Catch ex As Exception oErr.ThrowDBError(infoLabel, ex, Session("LoggedInUserID")) End Try If iNewContactID > 0 Then Response.Redirect("ContactManager.aspx?RecentContid=" & iNewContactID) End If End If End Sub Private Sub AddCompany_SelectedIndexChange(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddCompanyAddContacts.SelectedIndexChanged If ddCompanyAddContacts.SelectedValue = 0 Then Else Session("onCompanyChange") = ddCompanyAddContacts.SelectedValue Server.Transfer("ContactManager.aspx?compID=" & ddCompanyAddContacts.SelectedValue) End If End Sub Public Sub Search() If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then lblAcctMgr.Visible = False lstAcctMgr.Visible = False End If If Not Page.IsPostBack Then Dim iEmployeeID As Integer = 0 Dim iRecruitingTypeID As Integer = 0 If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then iEmployeeID = Session("LoggedInUserID") iRecruitingTypeID = Session("RecruitingTypeID") End If Dim oCompDAO As New CompanyDAO With ddCompanyContactSearch .DataSource = oCompDAO.PopulateCompany(iRecruitingTypeIDIn:=iRecruitingTypeID, iEmployeeIDIn:=iEmployeeID) .DataValueField = "CompanyID" .DataTextField = "CompanyName" .DataBind() .Items.Insert(0, New ListItem("-- Select --", 0)) End With With lstAcctMgr Dim empReader As XmlDataSource = New XmlDataSource empReader.DataFile = Constants.sXMLRoot & "acctmgrs.xml" If Session("VendorID") > 0 Then empReader.XPath = "//Employee[@VendorID=" & Session("VendorID") & "]" End If With lstAcctMgr .DataSource = empReader .DataTextField = "EmployeeName" .DataValueField = "EmployeeID" .DataBind() .Items.Insert(0, New ListItem("-- ANY --", 0)) .SelectedIndex = 0 End With End With End If End Sub Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitSearch.Click If ddCompanyContactSearch.SelectedIndex = 0 And _ txtName.Text = "" And _ txtEmail.Text = "" And _ txtFromDate.Text = "" And _ txtToDate.Text = "" And _ txtUpdFromDate.Text = "" And _ txtUpdToDate.Text = "" Then Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "Please enter criteria", Utilities.MessageLabel.WARNING) Exit Sub Else infoLabel.Text = "" End If Dim sFinalQuery As String = "" Dim blnUseContactQOnly As Boolean = False Dim blnIsFinal As Boolean = False If Not Session("CompQuery") Is Nothing Then Session("CompQuery") = "" Session("CompSort") = "" End If Dim sCompQuery As String = _ "SELECT DISTINCT c.CompanyID, 0 As CompanyContactID, '' As ContactName, " & _ "c.CompanyName As CompanyName, c.MainPhone As MainPhone, " & _ "'N/A' As MobilePhone, 'N/A' As Email, 'N/A' As JobTitle, c.DateModified As DateModified, " & _ "c.DateAdded As DateAdded, " & _ "CASE c.IsActive WHEN 1 THEN 'Yes' ELSE 'No' END as IsActive " & _ "FROM ConsultantCompany c " & _ "LEFT OUTER JOIN EmployeeToCompany etc ON etc.CompanyID = c.CompanyID " & _ "WHERE c.CompanyName <> ''" Dim sContactQuery As String = _ "SELECT DISTINCT c.CompanyID, cc.CompanyContactID, " & _ "cc.FirstName + ' ' + cc.LastName As ContactName, c.CompanyName As CompanyName, " & _ "cc.Phone As MainPhone, cc.Phone2 As MobilePhone, cc.Email As Email, " & _ "cc.JobTitle, cc.DateModified As DateModified, cc.DateAdded As DateAdded, " & _ "CASE cc.IsActive WHEN 1 THEN 'Yes' ELSE 'No' END as IsActive " & _ "FROM CompanyContact cc " & _ "INNER JOIN ConsultantCompany c ON c.CompanyID = cc.CompanyID " & _ "LEFT OUTER JOIN EmployeeToCompanyContact ec ON ec.CompanyContactID = cc.CompanyContactID " & _ "WHERE c.CompanyName <> '' " Select Case ddActiveContactSearch.SelectedItem.Value Case "Yes" sContactQuery &= "AND cc.IsActive = 1 " sCompQuery &= "AND c.IsActive = 1 " Case "No" sContactQuery &= "AND cc.IsActive = 0 " sCompQuery &= "AND c.IsActive = 0 " End Select If ddCompanyContactSearch.SelectedIndex > 0 Then 'If lstRetrieveCompany.SelectedIndex = 0 Then 'sFinalQuery = "Redirect" 'blnIsFinal = True 'Else sContactQuery &= "AND c.CompanyID = " & ddCompanyContactSearch.SelectedItem.Value If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then sContactQuery &= " AND ec.EmployeeID = " & Session("LoggedInUserID") End If blnIsFinal = True sFinalQuery = sContactQuery 'End If End If If Not blnIsFinal Then ' Create query with other criteria If Len(txtName.Text) > 0 Then sContactQuery &= "AND (CompanyName LIKE '%" & Utilities.SqlEncode(txtName.Text) & "%' OR cc.FirstName + ' ' + cc.LastName LIKE '%" & Utilities.SqlEncode(txtName.Text) & "%') " sCompQuery &= "AND CompanyName LIKE '%" & Utilities.SqlEncode(txtName.Text) & "%' " End If If Len(txtEmail.Text) > 0 Then sContactQuery &= "AND Email LIKE '%" & Utilities.SqlEncode(txtEmail.Text) & "%' " blnUseContactQOnly = True End If If Len(txtFromDate.Text) > 0 And Len(txtToDate.Text) > 0 And IsDate(txtFromDate.Text) And IsDate(txtToDate.Text) Then sContactQuery &= "AND (cc.DateAdded BETWEEN '" & txtFromDate.Text & "' AND '" & txtToDate.Text & "') " sCompQuery &= "AND (c.DateAdded BETWEEN '" & txtFromDate.Text & "' AND '" & txtToDate.Text & "') " End If If Len(txtUpdFromDate.Text) > 0 And Len(txtUpdToDate.Text) > 0 And IsDate(txtUpdFromDate.Text) And IsDate(txtUpdToDate.Text) Then sContactQuery &= "AND (cc.DateModified BETWEEN '" & txtUpdFromDate.Text & "' AND '" & txtUpdToDate.Text & "') " sCompQuery &= "AND (c.DateModified BETWEEN '" & txtUpdFromDate.Text & "' AND '" & txtUpdToDate.Text & "') " End If Dim sAcctMgrQ As String = "" If lstAcctMgr.SelectedIndex > 0 And PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then For Each acctmgr As ListItem In lstAcctMgr.Items If acctmgr.Selected Then If Len(sAcctMgrQ) > 0 Then sAcctMgrQ &= ", " & acctmgr.Value Else sAcctMgrQ = acctmgr.Value End If End If Next sAcctMgrQ = "AND ec.EmployeeID IN (" & sAcctMgrQ & ") " sContactQuery &= sAcctMgrQ blnUseContactQOnly = True ElseIf Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then sAcctMgrQ = "AND ec.EmployeeID = " & Session("LoggedInUserID") sContactQuery &= sAcctMgrQ sCompQuery &= "AND etc.EmployeeID = " & Session("LoggedInUserID") End If End If If Not blnUseContactQOnly And Not blnIsFinal Then sFinalQuery = sCompQuery & " UNION " & sContactQuery ElseIf Not blnIsFinal Then sFinalQuery = sContactQuery End If If sFinalQuery = "Redirect" Then Server.Transfer("ContactManager.aspx?compIDSearch=" & ddCompanyContactSearch.SelectedItem.Value) Else Session("CompQuery") = sFinalQuery pnlSearchResults.Visible = True pnlSearch.Visible = False BindGrid(sFinalQuery, "CompanyName") End If divCompaniesContact.Style.Add("Display", "None") AllContacts.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") popup.Hide() End Sub Private Sub BindGrid(ByVal sQuery As String, ByVal sSortIn As String) Dim ds As DataSet = DAO.CreateDataset(sQuery) Dim dv As DataView dv = ds.Tables(0).DefaultView If Len(sSortIn) = 0 Then dv.Sort = "CompanyName" Else dv.Sort = sSortIn End If With dgSearchResults .DataSource = dv .DataBind() End With If dv.Count > 0 Then lblRecCount.Text = dv.Count & " matching records found." dgSearchResults.Visible = True lblNoResults.Visible = False lblRecCount.Visible = True lnkExport.Visible = True Else lblNoResults.Text = "No results matched your search" lblNoResults.Visible = True dgSearchResults.Visible = False lblRecCount.Visible = False lnkExport.Visible = False End If For Each dgItem As DataGridItem In dgSearchResults.Items If dgItem.Cells(4).Text = "N/A" Then dgItem.BackColor = Color.LightSteelBlue End If Next End Sub Private Sub dgSearchResults_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgSearchResults.PageIndexChanged dgSearchResults.CurrentPageIndex = e.NewPageIndex Dim sSortOut As String = "" If ViewState("Sort") Is Nothing Then sSortOut = "CompanyName" Else sSortOut = ViewState("Sort") & " " & ViewState("Direction") End If BindGrid(Session("CompQuery"), sSortOut) AllContacts.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") popup.Hide() End Sub Protected Sub dgSearchResults_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dgSearchResults.SortCommand Dim strSort, strDirection As String strSort = ViewState("Sort") strDirection = ViewState("Direction") If (strSort <> e.SortExpression) Then strSort = e.SortExpression strDirection = "asc" Else If (strDirection = "asc") Then strDirection = "desc" Else strDirection = "asc" End If End If ViewState("Sort") = strSort ViewState("Direction") = strDirection Session("CompSort") = strSort + " " + strDirection BindGrid(Session("CompQuery"), strSort + " " + strDirection) AllContacts.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") popup.Hide() End Sub Protected Sub btnNewSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNewSearch.Click AllContacts.Style.Add("Display", "None") ViewProspects.Style.Add("Display", "None") AddContacts.Style.Add("Display", "None") AddCompanies.Style.Add("Display", "None") divCompanies.Style.Add("Display", "None") divCompaniesContact.Style.Add("Display", "None") divCompaniesInfo.Style.Add("Display", "None") AllCandidatesProspects.Style.Add("Display", "None") popup.Hide() pnlSearchResults.Visible = False pnlSearch.Visible = True End Sub Protected Sub lnkExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkExport.Click Dim oErr As New CustomErrors Try Response.AddHeader("content-disposition", "attachment;filename=CompanyContactSearch.xls") ' Set MIME type to Excel. Response.ContentType = "application/vnd.ms-excel" ' Remove the charset from the Content-Type header. Response.Charset = "" dgSearchResults.AllowPaging = False BindGrid(Session("CompQuery"), Session("CompSort")) Response.Write(Utilities.ExcelDataGrid(dgSearchResults, Nothing, "Company/Contact Search").ToString) Catch ex As Exception Response.Write("Excel export failed. Data could not be exported to Excel.") oErr.WriteError(ex, Session("LoggedInUserID")) Finally Response.End() End Try End Sub Public Sub PopulateCompanyInfo() If Request.Url.ToString.Contains("compIDSearch") Then companyID = Request.QueryString("compIDSearch") Else companyID = Request.QueryString("compid") End If Dim aCompList As New ArrayList aCompList = oEmpDAO.RetrieveEmployeeCompanies(Session("LoggedInUserID")) If aCompList.Contains(companyID) Or PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then imgEdit.Visible = True lbFullCOmpProfile.Text = "View Full Company Profile" End If 'If PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then 'pnlContracts.Visible = True 'End If lnkNewContact.NavigateUrl = "ContactManager.aspx?AddContact&compid=" & companyID lnkAddProspects.NavigateUrl = "ContactManager.aspx?AddContact&compid=" & companyID oComp = New Company oComp = oCompDAO.RetrieveCompany(companyID) If Session("RecruitingType") = "Institutional" Then lblHQ.Text = "Main Headquarters:" Page.Title = Session("AppName") & " - School Details" 'lblTypeIndicator.Text = "SCHOOL" pnlCompanyInfo.Visible = False pnlTime_Contracts.Visible = False pnlBillingAddresses.Visible = False lblCompanyDescription.Visible = False lblBenefits.Visible = False lblDescText.Visible = False lblBenefitsText.Visible = False pnlJobOrders.Visible = False End If lblCompanyName.Text = oComp.sCompanyName lblCompanyName1.Text = oComp.sCompanyName lblCompanyNameDisplay.Text = oComp.sCompanyName lblClassification.Text = oComp.sClassification lblCompanyClassidicationDisplay.Text = oComp.sClassification If oComp.dtModified = "1/1/1900" Then lblLastUpdated.Text = oComp.dtAdded Else lblLastUpdated.Text = oComp.dtModified End If lblModifier.Text = oComp.sModifier lblCompanyDescription.Text = Utilities.AddBreaks(oComp.sDescription) lblCompanyDiscriptionDisplay.Text = Utilities.AddBreaks(oComp.sDescription) lblBenefits.Text = Utilities.AddBreaks(oComp.sBenefits) lblCompanyBenifitDisplay.Text = Utilities.AddBreaks(oComp.sBenefits) If oComp.sBenefitsFile.Length > 0 Then lnkBenefitsFile.Visible = True lnkBenefitsFile.Text = "View Benefits File" lnkBenefitsFile.NavigateUrl = oComp.sBenefitsFile lnkBenefitsFile.Target = "_blank" End If lblPhone.Text = oComp.sMainPhone lblCompanyMainPhoneDisplay.Text = oComp.sMainPhone Dim sAddress As String Dim oLoc As New Company.CompanyLocation oLoc = oLocDAO.RetrieveCompanyLocation(0, oComp.iCompanyID) sAddress = oLoc.sAddress & "
" & oLoc.sCity & ", " & oLoc.sState & " " & oLoc.sZip If Len(oLoc.sAddress) > 0 Then lblHQAddress.Text = sAddress lblCompanyHeadquaterDisplay.Text = sAddress Else lblHQAddress.Text = "N/A" lblCompanyHeadquaterDisplay.Text = "N/A" End If lblWebsite.Text = "" & oComp.sWebsite & "" LblCompanyWebsiteDisplay.Text = "" & oComp.sWebsite & "" lblSource.Text = oComp.sSourceName lblHireTypes.Text = "" If Not oComp.aHireTypes Is Nothing Then For Each sHireType As String In oComp.aHireTypeNames lblHireTypes.Text &= "- " & sHireType & "
" Next End If lblActive.Text = Utilities.TFToYN(oComp.blnActive) If oComp.blnActive = False Then lblActive.ForeColor = Color.Red lblActive.Font.Bold = True lnkNewContact.Visible = False End If With rptLocations .DataSource = oLocDAO.PopulateLocationAddress(companyID) .DataBind() End With With rptBillingAddresses Dim oBillingDAO As New CompanyDAO.CompanyBillingAddressDAO .DataSource = oBillingDAO.PopulateBillingAddress(companyID) .DataBind() End With With rptTimeMgt2 .DataSource = oCompDAO.PopulateTimeMgt(companyID) .DataBind() End With If Not Page.IsPostBack Then BindGrid() BindJOGrid() End If End Sub Protected Sub lnkContract_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkContract.Click If Page.IsPostBack Then popupContracts.Show() popupJO.Hide() CompanyInfoPopup.Hide() popup.Hide() Me.IframeContracts.Attributes("src") = "CompanyContracts.aspx?companyid=" & Request.QueryString("compid") & "" End If End Sub Private Sub BindGrid() Dim oContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader If PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then dr = oContactDAO.GetContactsByCompanyID(companyID) Else dr = oContactDAO.GetContactsByCompanyID(companyID, iEmployeeIDIn:=Session("LoggedInUserID")) End If ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgContacts .DataSource = dv .DataBind() End With dr.Close() End Sub Private Sub BindJOGrid() Dim oJobDAO As New JobOrderDAO Dim dv As DataView dv = oJobDAO.JobOrderList(iCompany:=companyID).Tables(0).DefaultView dv.Sort = "DateModified desc" With dgJO .DataSource = dv .DataBind() End With End Sub Protected Sub ViewJobOrders(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) If Page.IsPostBack Then popupJO.Show() CompanyInfoPopup.Hide() popup.Hide() Me.IframeJobOrders.Attributes("src") = "JobOrderDetails.aspx?id=" & dgJO.DataKeys(e.Item.ItemIndex) End If End Sub Protected Sub lnkNewJob_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkNewJob.Click ScriptManager.RegisterStartupScript(Page, GetType(Page), "OpenWindow", "window.open('JobOrderForm.aspx?compid=" & Request.QueryString("compid") & "', '', 'location=0,menubar=0,resizable=1,width=900,height=400,left=100,top=200,scrollbars=1');", True) End Sub Protected Sub btnSendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSendEmail.Click ' Send candidate an e-mail with the company information/benefits oComp = New Company oComp = oCompDAO.RetrieveCompany(Request.QueryString("compid")) Try Dim blnSendBenefits As Boolean Dim sAttachment As String Dim sb As New StringBuilder With sb .Append("") .Append("

" & Session("LoggedInUserName") & " provided the following information about " & oComp.sCompanyName & ".

") .Append("

" & oComp.sCompanyName & "

") .Append("

" & oComp.sDescription & "

") If Len(oComp.sBenefits) > 0 Then .Append("

Benefits:
" & oComp.sBenefits & "

") End If If Len(txtAdditional.Text) > 0 Then .Append("

Additional Notes:
" & txtAdditional.Text & "

") End If If Len(oComp.sBenefitsFile) > 0 Then blnSendBenefits = True End If .Append("") End With If blnSendBenefits Then sAttachment = oComp.sActualBenefitsFile Else sAttachment = "" End If Utilities.SendEmail(txtCandidateEmail.Text, Session("LoggedInUserEmail"), oComp.sCompanyName & " - Information", sb.ToString, sAttachment) txtCandidateEmail.Text = "" txtAdditional.Text = "" lblEmailOK.Visible = True Utilities.MessageLabel.DisplayMessageLabel(lblEmailOK, "Email sent!", Utilities.MessageLabel.CONFIRM) Catch ex As Exception oErr.ThrowEmailError(infoLabel, ex, Session("LoggedInUserID")) End Try End Sub '''''''''''''''''''''''''''''''''''''old contracts''''''''''''''''''''''''''''''''''''''''' ' Private Sub BindContractGrid() 'Dim oContractsDAO As New ContractsDAO ' With dgContracts ' .DataSource = oContractsDAO.RetrieveContractInfo(Request.QueryString("compid")) ' .DataBind() ' End With ' End Sub 'Protected Sub dgContracts_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgContracts.CancelCommand ' dgContracts.EditItemIndex = -1 ' BindContractGrid() ' CompanyInfoPopup.Show() ' End Sub 'Protected Sub dgContracts_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgContracts.EditCommand ' dgContracts.EditItemIndex = e.Item.ItemIndex ' BindContractGrid() ' CompanyInfoPopup.Show() ' End Sub 'Protected Sub dgContracts_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgContracts.UpdateCommand ' Try 'Dim oCompDAO As New CompanyDAO 'Dim oContract As New Contracts 'Dim oContractsDAO As New ContractsDAO 'Dim sStart As String, sEnd As String ' sStart = CType(e.Item.FindControl("txtStart"), TextBox).Text ' sEnd = CType(e.Item.FindControl("txtEnd"), TextBox).Text ' With oContract ' .iContractID = dgContracts.DataKeys(e.Item.ItemIndex) ' .sContractName = CType(e.Item.FindControl("txtName"), TextBox).Text ' .sContractType = CType(e.Item.FindControl("txtType"), TextBox).Text ' If Len(sStart) > 0 And IsDate(sStart) Then ' .dtStartDate = CDate(sStart) ' Else ' .dtStartDate = "1/1/1900" ' End If 'If Len(sEnd) > 0 And IsDate(sEnd) Then ' .dtEndDate = CDate(sEnd) 'Else ' .dtEndDate = "1/1/1900" 'End If 'End With ' oContractsDAO.UpdateContractInfo(oContract, Session("LoggedInUserID")) ' dgContracts.EditItemIndex = -1 '' BindContractGrid() ' CompanyInfoPopup.Show() 'Catch Ex As Exception ' oErr.ThrowDBError(infoLabel, Ex, Session("LoggedInUserID")) 'End Try 'End Sub Public Sub RecentCandidatesDashBoard() Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCandDAO.RetrieveCandidatesByEmployeeID(iEmployeeIDIn:=Session("LoggedInUserID"), blnShowProspects:=False) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "FirstName" With dgTask .DataSource = dv .DataBind() End With Dim dt As Date = Now dt = dt.AddDays(-90) For Each dvd As DataGridItem In dgTask.Items If dvd.Cells(3).Text >= dt.ToShortDateString Then If dvd.Cells(3).Text.Contains(Date.Now.Year) Then Else dvd.Cells(0).Visible = False dvd.Cells(1).Visible = False dvd.Cells(2).Visible = False dvd.Cells(3).Visible = False End If Else dvd.Cells(0).Visible = False dvd.Cells(1).Visible = False dvd.Cells(2).Visible = False dvd.Cells(3).Visible = False End If Next dr.Close() End Sub Public Sub ReminderDashBoard() Dim tblRow As TableRow Dim tblCell As TableCell Dim oTaskDAO As New TasksDAO Dim tasksRdr As SqlClient.SqlDataReader tasksRdr = oTaskDAO.RetrieveTasksByEmployeeID(Session("LoggedInUserID"), Today.ToShortDateString, Today.AddDays(+1)) If tasksRdr.HasRows Then Dim t As Integer = 0 While tasksRdr.Read tblRow = New TableRow tblCell = New TableCell tblRow.Cells.Add(tblCell) tblCell = New TableCell If tasksRdr("CandidateID") > 0 Then tblCell.Text = "" & tasksRdr("Candidate") & "" ElseIf tasksRdr("JobOrderID") > 0 Then tblCell.Text = "" & tasksRdr("Job Order") & "" ElseIf tasksRdr("CompanyContactID") > 0 Then tblCell.Text = "" & tasksRdr("Contact") & "" End If tblRow.Cells.Add(tblCell) tblCell = New TableCell If Len(tasksRdr("TaskNotes")) > 100 Then tblCell.Text = Left(tasksRdr("TaskNotes"), 100) & "..." Else tblCell.Text = tasksRdr("TaskNotes") End If tblRow.Cells.Add(tblCell) tblTasks.Rows.Add(tblRow) t += 1 End While Else tblRow = New TableRow tblCell = New TableCell tblCell.Text = "No tasks are scheduled for this today" tblRow.Cells.Add(tblCell) tblTasks.Rows.Add(tblRow) End If tasksRdr.Close() End Sub Public Sub RecentContactsDashBoard() Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.RetrieveEmployeeContacts(iEmployeeIDIn:=Session("LoggedInUserID"), blnRecentContactsIn:=True) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgRecentContacts .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub RecentCompaniesDashBoard() Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompDAO.PopulateCompany(iEmployeeIDIn:=Session("LoggedInUserID"), blnRecentCompanies:=True) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView With dgRecentCompanies .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub ProspectDashBoard() Dim oCompContactDAO As New CompanyContactDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCompContactDAO.RetrieveEmployeeContacts(iEmployeeIDIn:=Session("LoggedInUserID"), blnProspectIn:=True) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "ContactName" With dgProspectDashBoard .DataSource = dv .DataBind() End With Dim dt As Date = Now dt = dt.AddDays(-90) For Each dvd As DataGridItem In dgTask.Items If dvd.Cells(3).Text >= dt.ToShortDateString Then If dvd.Cells(3).Text.Contains(Date.Now.Year) Then Else dvd.Cells(0).Visible = False dvd.Cells(1).Visible = False dvd.Cells(2).Visible = False dvd.Cells(3).Visible = False End If Else dvd.Cells(0).Visible = False dvd.Cells(1).Visible = False dvd.Cells(2).Visible = False dvd.Cells(3).Visible = False End If Next dr.Close() End Sub Protected Sub ViewAllPros(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Session("contactId") = dgProspectDashBoard.DataKeys(e.Item.ItemIndex) Response.Redirect("ContactManager.aspx?ProspectContactid=" & Session("contactId")) If Not Page.IsPostBack Then popup.Show() End If End Sub Protected Sub ViewAllCanPros(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Session("CandidateId") = dgCandidatesProspects.DataKeys(e.Item.ItemIndex) Response.Redirect("ContactManager.aspx?ProspectCandidateid=" & Session("CandidateId")) If Not Page.IsPostBack Then popupCandidate.Show() CompanyInfoPopup.Hide() End If End Sub Protected Sub ViewAllCanProsDash(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Session("CandidateId") = dgDashCanPros.DataKeys(e.Item.ItemIndex) Response.Redirect("ContactManager.aspx?Dashcandid=" & Session("CandidateId")) If Not Page.IsPostBack Then popupCandidate.Show() CompanyInfoPopup.Hide() End If End Sub Protected Sub ViewCompPros(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Session("contactId") = dgCompProspects.DataKeys(e.Item.ItemIndex) Response.Redirect("ContactManager.aspx?compid=" & Request.QueryString("compid") & "&contactid=" & Session("contactId") & "#fragment-15") popup.Show() CompanyInfoPopup.Hide() End Sub Public Sub CandidateProspectDashBoard() Dim oCandDAO As New CandidateDAO Dim ds As DataSet Dim dv As DataView Dim dr As SqlClient.SqlDataReader dr = oCandDAO.RetrieveCandidateProspectinReader(iEmployeeIDIn:=Session("LoggedInUserID")) ds = DAO.ConvertDataReaderToDataSet(dr) dv = ds.Tables(0).DefaultView dv.Sort = "FirstName" With dgDashCanPros .DataSource = dv .DataBind() End With dr.Close() End Sub Public Sub AddUpdateCompany() Utilities.CreateConfirmBox(btnDelete, "Are you sure?") If Not Session("IsAcctManager") Then 'Server.Transfer("NoAccess.aspx") End If If Len(Request.QueryString("compid")) > 0 And IsNumeric(Request.QueryString("compid")) Then companyID = Request.QueryString("compid") Dim oEmpDAO As New EmployeeDAO Dim aCompList As New ArrayList aCompList = oEmpDAO.RetrieveEmployeeCompanies(Session("LoggedInUserID")) If Not aCompList.Contains(companyID) And Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then 'Server.Transfer("NoAccess.aspx") End If Else companyID = 0 End If hdnRecruitingTypeID.Value = Session("RecruitingTypeID") If Session("RecruitingType") = "Institutional" Then DisplaySchoolProperties() End If If Not Page.IsPostBack Then With ddClassifications .DataSource = oCompDAO.PopulateClassification(hdnRecruitingTypeID.Value) .DataValueField = "ClassificationID" .DataTextField = "ClassificationName" .DataBind() End With With lstTimeMgt .DataSource = oCompDAO.PopulateTimeMgt .DataValueField = "TimeMgtID" .DataTextField = "SystemName" .DataBind() End With With ddSource .DataSource = oCompDAO.PopulateCompanySource .DataValueField = "CompanySourceID" .DataTextField = "SourceName" .DataBind() .Items.Insert(0, "-- Select --") End With Dim oCons As New ConsultantDAO With chkHireTypes .DataSource = oCons.PopulateHireTypes(True) .DataValueField = "HireTypeID" .DataTextField = "HireTypeName" .DataBind() End With If Not PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then ddActive.Enabled = False End If If companyID > 0 Then oComp = New Company If Session("RecruitingType") = "Institutional" Then DisplaySchoolProperties() recruitingType = oComp.sRecruitingType End If oComp = oCompDAO.RetrieveCompany(companyID) hdnRecruitingTypeID.Value = oComp.iRecruitingTypeID txtCompanyName.Text = oComp.sCompanyName txtCompanyPhone.Text = oComp.sMainPhone txtDescription.Text = Utilities.RemoveBreaks(oComp.sDescription) txtBenefits.Text = Utilities.RemoveBreaks(oComp.sBenefits) hdnBenefitsFile.Value = oComp.sBenefitsFile txtWebsite.Text = oComp.sWebsite hdnCompanyID.Value = oComp.iCompanyID ddClassifications.SelectedValue = oComp.iClassificationID ddSource.SelectedValue = oComp.iCompanySourceID If Not oComp.aHireTypes Is Nothing Then For Each ht As Integer In oComp.aHireTypes chkHireTypes.Items.FindByValue(ht).Selected = True Next End If ddActive.SelectedValue = CInt(oComp.blnActive) Dim oContractsDAO As New ContractsDAO With rptLocationList .DataSource = oLocDAO.PopulateLocationAddress(companyID, True) .DataBind() End With With rptTimeMgt .DataSource = oCompDAO.PopulateTimeMgt(companyID) .DataBind() End With ' If location was passed in, populate location fields If Len(Request.QueryString("locationid")) > 0 Then If Request.QueryString("billing") = 0 Then oLocation = New Company.CompanyLocation oLocation = oLocDAO.RetrieveCompanyLocation(Request.QueryString("locationid")) With oLocation txtNewAddr.Text = .sAddress txtNewCity.Text = .sCity txtNewState.Text = .sState txtNewZip.Text = .sZip hdnLocationID.Value = .iLocationID chkBillingAddr.Checked = False chkHeadquarters.Checked = .blnIsHeadquarters hdnBilling.Value = 0 End With Else oBillLoc = New Company.CompanyBillingAddress oBillLoc = oBillLocDAO.RetrieveBillingAddress(Request.QueryString("locationid")) With oBillLoc txtNewAddr.Text = .sAddress txtNewCity.Text = .sCity txtNewState.Text = .sState txtNewZip.Text = .sZip hdnLocationID.Value = .iBillingAddressID chkBillingAddr.Checked = True chkHeadquarters.Checked = False hdnBilling.Value = 1 End With End If btnSubmitAddress.Visible = True btnDelete.Visible = True btnCancel.Visible = True lblLocation.Text = "Update Location" End If If Len(Request.QueryString("timemgtid")) > 0 Then oCompDAO.DeleteTimeMgtByTimeMgtID(Request.QueryString("timemgtid")) Server.Transfer("ContactManager.aspx?compid=" & companyID) End If If Len(Request.QueryString("contractid")) > 0 Then If PermissionCheck.EmployeeIsAdminOrMgr(Session("LoggedInUserType")) Then oContractsDAO.DeleteContract(Request.QueryString("contractid")) Server.Transfer("ContactManager.aspx?compid=" & companyID) Else Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "Contracts can only be deleted by a manager or administrator", Utilities.MessageLabel.WARNING) End If End If Else ddActive.Enabled = False End If End If LnkAddCompany.NavigateUrl = "ContactManager.aspx?AddCompany" End Sub Protected Sub btnSubmitCompany_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitCompany.Click oComp = New Company ' Insert new company information into database Dim iNewCompanyID As Integer Dim blnUpdated As Boolean Dim iSourceBurden As Integer = 500 Dim iPaymentPolicy As Integer = 30 ' Check to see if benefits document was uploaded Dim sBenefitsPath As String = "" Dim sWebSite As String If Len(fileBenefits.Value) > 0 Then sBenefitsPath = Utilities.UploadToFile(fileBenefits, Constants.sBenefitsPath) End If With oComp .sCompanyName = txtCompanyName.Text .iClassificationID = ddClassifications.SelectedItem.Value .sMainPhone = txtCompanyPhone.Text If txtWebsite.Text.Contains("http://") Then sWebSite = txtWebsite.Text Else sWebSite = "http://" & txtWebsite.Text End If .sWebsite = sWebSite .sDescription = txtDescription.Text .sBenefits = txtBenefits.Text .iRecruitingTypeID = hdnRecruitingTypeID.Value If Not fileBenefits.PostedFile Is Nothing Then If fileBenefits.PostedFile.FileName.Length = 0 Then If Len(hdnBenefitsFile.Value) > 0 And Not hdnBenefitsFile.Value = Constants.sURLPrefix Then .sBenefitsFile = hdnBenefitsFile.Value Else .sBenefitsFile = "" End If Else If Len(hdnBenefitsFile.Value) > 0 And Not hdnBenefitsFile.Value = Constants.sURLPrefix Then .sBenefitsFile = hdnBenefitsFile.Value Else .sBenefitsFile = "" End If End If Else .sBenefitsFile = "" End If If ddSource.SelectedIndex > 0 Then .iCompanySourceID = ddSource.SelectedItem.Value Else .iCompanySourceID = 0 End If End With Dim blnOK As Boolean = True Try If hdnCompanyID.Value = 0 Then ' Insert new company iNewCompanyID = oCompDAO.InsertCompany(Session("LoggedInUserID"), oComp) Else oComp.iCompanyID = hdnCompanyID.Value iNewCompanyID = oComp.iCompanyID oComp.blnActive = ddActive.SelectedItem.Value blnUpdated = oCompDAO.UpdateCompany(Session("LoggedInUserID"), oComp) End If If iNewCompanyID > 0 Then ' Insert hire types if they exist If hdnCompanyID.Value > 0 Then oCompDAO.DeleteCompanyToHireType(iNewCompanyID) End If For Each hireType As ListItem In chkHireTypes.Items If hireType.Selected Then oCompDAO.InsertCompanyToHireType(iNewCompanyID, hireType.Value) End If Next If txtNewAddr.Text.Length > 0 And txtNewCity.Text.Length > 0 And txtNewState.Text.Length > 0 And txtNewZip.Text.Length > 0 And hdnLocationID.Value = 0 Then ' Add new address Dim iNewAddr As Integer If chkBillingAddr.Checked Then Dim oBillLoc As New Company.CompanyBillingAddress Dim oBillLocDAO As New CompanyDAO.CompanyBillingAddressDAO With oBillLoc .iCompanyID = iNewCompanyID .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text End With iNewAddr = _ oBillLocDAO.InsertBillingAddress(oBillLoc) ' If company is new making first billing address the main address of the company If hdnCompanyID.Value = 0 Then oLocation = New Company.CompanyLocation With oLocation .iCompanyID = iNewCompanyID .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" .blnIsHeadquarters = chkHeadquarters.Checked End With iNewAddr = _ oLocDAO.InsertCompanyAddress(oLocation) End If Else oLocation = New Company.CompanyLocation With oLocation .iCompanyID = iNewCompanyID .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" .blnIsHeadquarters = chkHeadquarters.Checked End With iNewAddr = _ oLocDAO.InsertCompanyAddress(oLocation) End If End If Dim oContract As Contracts Dim dtStartDate As Date = "1/1/1900" Dim dtEndDate As Date = "1/1/1900" If txtNewSystem.Text.Length > 0 Then oCompDAO.InsertTimeMgt(0, txtNewSystem.Text, iNewCompanyID) txtNewSystem.Text = "" End If If lstTimeMgt.SelectedIndex > -1 Then For Each lstItem As ListItem In lstTimeMgt.Items If lstItem.Selected Then oCompDAO.InsertTimeMgt(lstItem.Value, lstItem.Text, iNewCompanyID) End If Next End If lstTimeMgt.SelectedIndex = -1 Else Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "0 was returned as ID. Insert or update of company failed.", Utilities.MessageLabel.WARNING) blnOK = False End If Catch ex As Exception oErr.ThrowDBError(infoLabel, ex, Session("LoggedInUserID")) blnOK = False End Try If blnOK Then Server.Transfer("ContactManager.aspx?compid=" & iNewCompanyID) End If End Sub Protected Sub btnSubmitAddress_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitAddress.Click Dim blnOK As Boolean Try If hdnBilling.Value = 0 Then ' Address being updated is not a billing address ' but is being updated as such. If chkBillingAddr.Checked Then oLocDAO.DeleteCompanyLocation(hdnLocationID.Value) oBillLoc = New Company.CompanyBillingAddress With oBillLoc .iCompanyID = hdnCompanyID.Value .iBillingAddressID = hdnLocationID.Value .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" End With oBillLocDAO.InsertBillingAddress(oBillLoc) blnOK = True Else ' Address is a location address and just needs to be updated. Dim oLocation As New Company.CompanyLocation With oLocation .iCompanyID = hdnCompanyID.Value .iLocationID = hdnLocationID.Value .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" .blnIsHeadquarters = chkHeadquarters.Checked End With oLocDAO.UpdateCompanyAddress(oLocation) blnOK = True End If ElseIf hdnBilling.Value = 1 Then ' Address is a billing address and is being updated If chkBillingAddr.Checked Then oBillLoc = New Company.CompanyBillingAddress With oBillLoc .iCompanyID = hdnCompanyID.Value .iBillingAddressID = hdnLocationID.Value .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" End With oBillLocDAO.UpdateBillingAddress(oBillLoc) blnOK = True Else ' Address is a billing address and is being specified as ' not a billing address oBillLocDAO.DeactivateBillingAddress(hdnLocationID.Value) Dim oLocation As New Company.CompanyLocation With oLocation .iCompanyID = hdnCompanyID.Value .iLocationID = hdnLocationID.Value .sAddress = txtNewAddr.Text .sCity = txtNewCity.Text .sState = txtNewState.Text .sZip = txtNewZip.Text .sPhone = "" .blnIsHeadquarters = chkHeadquarters.Checked End With oLocDAO.InsertCompanyAddress(oLocation) blnOK = True End If End If Catch ex As Exception oErr.ThrowDBError(infoLabel, ex, Session("LoggedInUserID")) blnOK = False End Try If blnOK Then Server.Transfer("ContactManager.aspx?compid=" & Request.QueryString("compid")) End If End Sub Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click If Request.QueryString("compid") > 0 Then Server.Transfer("ContactManager.aspx?compid=" & Request.QueryString("compid")) Else Server.Transfer("ContactManager.aspx") End If End Sub Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim blnOK As Boolean Try If hdnBilling.Value = 1 Then oBillLocDAO.DeactivateBillingAddress(hdnLocationID.Value) Else oLocDAO.DeleteCompanyLocation(hdnLocationID.Value) End If blnOK = True Catch ex As Exception oErr.ThrowDBError(infoLabel, ex, Session("LoggedInUserID")) blnOK = False End Try If blnOK Then Server.Transfer("ContactManager.aspx?compid=" & Request.QueryString("compid")) End If End Sub Protected Sub lnkResetDash_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkResetDash.Click For i As Integer = 1 To 3 Dim ds2 As ds_widgetTableAdapters.widgetsDetailTableAdapter = New ds_widgetTableAdapters.widgetsDetailTableAdapter Dim dt2 As New DataTable dt2 = ds2.GetData(i, Session("LoggedInUserID")) For a As Integer = 0 To dt2.Rows.Count - 1 Dim exWidgets As Widgets exWidgets = oWidgetsDAO.RetrieveWidgets(oEmployeeIDIn:=Session("LoggedInUserID")) oWidgets.iWidgetID = dt2.Rows(a)("id") oWidgets.iCollapsed = 1 oWidgets.iSort = 1 oWidgets.iColumnID = 1 oWidgets.sWidgetTitle = exWidgets.sWidgetTitle oWidgets.iWidgetWidth = 240 oWidgets.iWidgetHeight = 220 oWidgets.iEmployeeID = Session("LoggedInUserID") oWidgetsDAO.InsertUpdateWidgets(iAddUpdateIn:=1, oWidgetsIn:=oWidgets) Next Next Response.Redirect("ContactManager.aspx?Dashboard") End Sub Protected Sub lnkCreateWidgets_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkCreateWidgets.Click Dim counter As Integer = 0 While counter < 6 counter += 1 oWidgets.iSort = 1 oWidgets.iCollapsed = 0 If counter = 1 Then oWidgets.sWidgetTitle = "Recently Added Candidates" oWidgets.iColumnID = 1 End If If counter = 2 Then oWidgets.sWidgetTitle = "Candidate Prospects" oWidgets.iColumnID = 1 End If If counter = 3 Then oWidgets.sWidgetTitle = "Contact Prospects" oWidgets.iColumnID = 2 End If If counter = 4 Then oWidgets.sWidgetTitle = "Recently Added Contacts" oWidgets.iColumnID = 2 End If If counter = 5 Then oWidgets.sWidgetTitle = "Recently Added Companies" oWidgets.iColumnID = 3 End If If counter = 6 Then oWidgets.sWidgetTitle = "Task Reminders" oWidgets.iColumnID = 3 End If oWidgets.iWidgetWidth = 240 oWidgets.iWidgetHeight = 225 oWidgets.iEmployeeID = Session("LoggedInUserID") oWidgetsDAO.InsertUpdateWidgets(iAddUpdateIn:=0, oWidgetsIn:=oWidgets) End While Response.Redirect("ContactManager.aspx?Dashboard") End Sub Public Sub ProspectCandidate() 'lbProsCanEdit.Text = "Edit" oCand = New Candidate If Request.Url.ToString.Contains("ProspectCandidateid") Then oCand = oCandDAO.RetrieveCandidate(iCandIDIn:=Session("CandidateId")) Else oCand = oCandDAO.RetrieveCandidate(iCandIDIn:=Request.QueryString("candid")) End If If Request.Url.ToString.Contains("Dashcandid") Then oCand = oCandDAO.RetrieveCandidate(iCandIDIn:=Request.QueryString("Dashcandid")) End If lblSkills.Text = oCandDAO.CandidateSkillsList(oCand.iCandID) lblName.Text = oCand.sFullName lblMostRecent.Text = oCand.sCompanyName lblEmail1.Text = "" & oCand.sEmail & "" lblTitle.Text = oCand.sTitle lblAddress.Text = oCand.sAddress lblDayPhone.Text = oCand.sDayPhone lblEvePhone.Text = oCand.sEveningPhone lblMobPhone.Text = oCand.sMobilePhone 'lblEmail1.Text = oCand.sPrimEmail 'lblEmail2.Text = oCand.sSecondEmail lblWorkStatus.Text = oCand.sWorkStatus lblVisaStatus.Text = oCand.sVisaStatus lblIsEmployed.Text = oCand.sIsEmployed 'lblGender.Text = oCand.sGender 'lblRace.Text = oCand.sRace lblPreferred.Text = oCand.sPrefMethod Dim sSource As String If Len(oCand.sOtherSource) > 0 Then sSource = oCand.sSource & " - " & oCand.sOtherSource Else sSource = oCand.sSource End If lblSource.Text = sSource oReferralDAO = New ReferralDAO Dim iReferredBy As Integer = oReferralDAO.RetrieveReferrerByReferred(oCand.iCandID) If iReferredBy > 0 Then lblReferrer.Visible = True lblReferrerName.Visible = True Dim oReferredBy As New Candidate oReferredBy = oCandDAO.RetrieveCandidate(iReferredBy) lblReferrerName.Text = "" & oReferredBy.sFullName & "" End If lblFoundUs.Text = Utilities.TFToYN(oCand.blnCandidateFoundUs) oEmp = New Employee oEmp = oEmpDAO.RetrieveEmployee(oCand.iEmployeeOwnerID) lblOwner.Text = "" & oCand.sOwner & "" lblEntryDate.Text = oCand.sDateEntered lblLastEditor.Text = oCand.sLastEditor lblLastEdit.Text = oCand.sDateModified lblCurrTitle.Text = oCand.sTitle lblJobCategory.Text = oCand.sJobCategory lblJobSubCategory.Text = oCand.sJobSubCategory 'lblCommunication.Text = oCand.iCommLevel lblFTOnly.Text = Utilities.TFToYN(oCand.blnFTOnly) lblConsOnly.Text = Utilities.TFToYN(oCand.blnConsOnly) lblFTCons.Text = Utilities.TFToYN(oCand.blnFTCons) lblAvailNow.Text = Utilities.TFToYN(oCand.blnIsAvailNow) 'lblTests.Text = sTestList 'lblCurrSalary.Text = FormatCurrency(oCand.dCurrentSalary, 2) 'lblSalaryDesired.Text = FormatCurrency(oCand.dDesiredSalary, 2) 'lblMinAccepted.Text = FormatCurrency(oCand.dMinSalaryAccepted, 2) 'lblBonus.Text = oCand.sBonus 'lblCurrRate.Text = sCurrRate 'lblRateDesired.Text = sDesiredRate 'lblMinRate.Text = sAcceptedRate 'lblPackageRate.Text = FormatCurrency(oCand.dPackageRate, 2) 'sNotes = oCand.sNotes 'lblNotes.Text = sNotes 'lblRecruiterNotes.Text = oCand.sRecruiterNotes 'lblIndustry.Text = oCand.sIndustry 'If Not oCand.blnIsIntern Then 'lblCertification.Text = oCand.sCert 'lblDegree.Text = oCand.sDegree 'lblCollege.Text = oCand.sSchoolName 'lblEdLevel.Text = oCand.sEducationLevel 'lblExpYears.Text = oCand.iYearsExp 'Else ' If candidate is intern, hide career-related fields 'lblDegreeText.Text = "Degree In Process:" 'lblDegree.Text = oIntern.sDegree 'lblCertificationText.Text = "Is International?:" 'lblCertification.Text = Utilities.TFToYN(oIntern.blnInternational) 'lblDegreeText.Text = "Degree In Process:" 'lblDegree.Text = oIntern.sDegree 'lblYearsText.Text = "Graduation Date:" 'lblExpYears.Text = oIntern.dtGraduation 'lblProgramText.Visible = True 'lblProgram.Visible = True 'lblProgram.Text = oIntern.sProgram 'If oIntern.iSchoolID > 0 Then 'lblCollege.Text = oIntern.sSchool_Company ' Else 'lblCollege.Text = oIntern.sOtherSchool ' End If End Sub Protected Sub lbProsCanEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbProsCanEdit.Click popupJO.Show() CompanyInfoPopup.Hide() popup.Hide() Me.IframeJobOrders.Attributes("src") = "AddProspectCandidate.aspx?candid=" & Session("CandidateId") End Sub Protected Sub btnGoAutoComplete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGoAutoComplete.Click Dim SplitIt As String = txtCompName.Text Dim SrtArray() As String Dim count As Integer SrtArray = SplitIt.Split("|") For count = 1 To SrtArray.Length - 1 Response.Redirect("ContactManager.aspx?compid=" & SrtArray(count)) Next End Sub Protected Sub btnAllContactsSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAllContactsSearch.Click Dim SplitItCon As String = txtAllContactsSearch.Text Dim ConArray() As String Dim count As Integer ConArray = SplitItCon.Split("|") For count = 1 To ConArray.Length - 1 Session("Contactid") = ConArray(count) ScriptManager.RegisterStartupScript(UpdatePanel8, UpdatePanel8.GetType(), "OpenWindow", "window.open('ContactDetails.aspx?contactid=" & Session("Contactid") & "', '', 'location=0,menubar=0,resizable=1,width=800,height=400,left=100,top=200,scrollbars=1');", True) Next End Sub Protected Sub btnAllCanSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAllCanSearch.Click Dim SplitItCon As String = txtAllCanSearch.Text Dim ConArray() As String Dim count As Integer ConArray = SplitItCon.Split("|") For count = 1 To ConArray.Length - 1 Session("CandidID") = ConArray(count) ScriptManager.RegisterStartupScript(UpdatePanel6, UpdatePanel6.GetType(), "OpenWindow", "window.open('CandidateDetails.aspx?candid=" & Session("CandidID") & "', '', 'location=0,menubar=0,resizable=1,width=900,height=400,left=100,top=200,scrollbars=1');", True) Next End Sub Protected Sub btnColor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnColor.Click bgColor() eHirePowerBGcolor() NavHeaderColor() NavBackColor() NavTextColor() MainHeaderColor() MainHeaderText() MainSubheader() MainBackColor() Response.Redirect("ContactManager.aspx") End Sub Protected Sub btnResetColor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnResetColor.Click If (Not Request.Cookies("bgColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("bgColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("eHirePowerBGcolor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("eHirePowerBGcolor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("NavHeaderColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("NavHeaderColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("NavBackColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("NavBackColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("NavTextColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("NavTextColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("MainHeaderColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("MainHeaderColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("MainHeaderText") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("MainHeaderText") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("CalendarHeaderColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("CalendarHeaderColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("CalendarText") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("CalendarText") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("CalendarBack") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("CalendarBack") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("CalendarSubheader") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("CalendarSubheader") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("MainSubheader") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("MainSubheader") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If If (Not Request.Cookies("MainBackColor") Is Nothing) Then Dim myCookie As HttpCookie myCookie = New HttpCookie("MainBackColor") myCookie.Expires = DateTime.Now.AddDays(-1D) Response.Cookies.Add(myCookie) End If Response.Redirect("ContactManager.aspx") End Sub Private Sub bgColor() Dim BGcookie As New HttpCookie("bgColor") BGcookie.Value = txtBGcolor.Text BGcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) Body.Style("background-color") = "#" + txtBGcolor.Text Response.SetCookie(BGcookie) End Sub Private Sub eHirePowerBGcolor() Dim eHirePowerBGcolor As New HttpCookie("eHirePowerBGcolor") eHirePowerBGcolor.Value = txtHeaderBG.Text eHirePowerBGcolor.Expires = DateAdd(DateInterval.Year, 1, Now()) Response.SetCookie(eHirePowerBGcolor) End Sub Private Sub NavHeaderColor() Dim HeadersCookie As New HttpCookie("NavHeaderColor") HeadersCookie.Value = txtHeadBack.Text HeadersCookie.Expires = DateAdd(DateInterval.Year, 1, Now()) accordian1.Style.Add("background-color", "#" + txtHeadBack.Text) accordian2.Style.Add("background-color", "#" + txtHeadBack.Text) accordian3.Style.Add("background-color", "#" + txtHeadBack.Text) accordian4.Style.Add("background-color", "#" + txtHeadBack.Text) accordian5.Style.Add("background-color", "#" + txtHeadBack.Text) Response.SetCookie(HeadersCookie) End Sub Private Sub NavBackColor() Dim NavBackcookie As New HttpCookie("NavBackColor") NavBackcookie.Value = txtNavBackColor.Text NavBackcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) ul.Style("background-color") = "#" + txtNavBackColor.Text Response.SetCookie(NavBackcookie) End Sub Private Sub NavTextColor() Dim NavTextcookie As New HttpCookie("NavTextColor") NavTextcookie.Value = txtNavTextColor.Text NavTextcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) ul.Style("color") = "#" + txtNavTextColor.Text lnkResetDash.Style("color") = "#" + txtNavTextColor.Text NavigatorDiv.Style("color") = "#" + txtNavTextColor.Text Response.SetCookie(NavTextcookie) End Sub Private Sub MainHeaderColor() Dim MainHeaderColorcookie As New HttpCookie("MainHeaderColor") MainHeaderColorcookie.Value = txtMainHeaderColor.Text MainHeaderColorcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) Div1.Style("background-color") = "#" + txtMainHeaderColor.Text Div2.Style("background-color") = "#" + txtMainHeaderColor.Text Div3.Style("background-color") = "#" + txtMainHeaderColor.Text Div4.Style("background-color") = "#" + txtMainHeaderColor.Text Div5.Style("background-color") = "#" + txtMainHeaderColor.Text Div6.Style("background-color") = "#" + txtMainHeaderColor.Text Div7.Style("background-color") = "#" + txtMainHeaderColor.Text Div8.Style("background-color") = "#" + txtMainHeaderColor.Text Div9.Style("background-color") = "#" + txtMainHeaderColor.Text Div10.Style("background-color") = "#" + txtMainHeaderColor.Text Div11.Style("background-color") = "#" + txtMainHeaderColor.Text Div12.Style("background-color") = "#" + txtMainHeaderColor.Text Div13.Style("background-color") = "#" + txtMainHeaderColor.Text Div14.Style("background-color") = "#" + txtMainHeaderColor.Text Div15.Style("background-color") = "#" + txtMainHeaderColor.Text Div16.Style("background-color") = "#" + txtMainHeaderColor.Text Div17.Style("background-color") = "#" + txtMainHeaderColor.Text Div18.Style("background-color") = "#" + txtMainHeaderColor.Text Div19.Style("background-color") = "#" + txtMainHeaderColor.Text Div20.Style("background-color") = "#" + txtMainHeaderColor.Text popupNavDiv.Style("background-color") = "#" + txtMainHeaderColor.Text popupNavDiv2.Style("background-color") = "#" + txtMainHeaderColor.Text tabcontainer.Style("background-color") = "#" + txtMainHeaderColor.Text Response.SetCookie(MainHeaderColorcookie) End Sub Private Sub MainHeaderText() Dim MainHeaderTextcookie As New HttpCookie("MainHeaderText") MainHeaderTextcookie.Value = txtMainHeaderText.Text MainHeaderTextcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) Div1.Style("color") = "#" + txtMainHeaderText.Text Div2.Style("color") = "#" + txtMainHeaderText.Text Div3.Style("color") = "#" + txtMainHeaderText.Text Div4.Style("color") = "#" + txtMainHeaderText.Text Div5.Style("color") = "#" + txtMainHeaderText.Text Div6.Style("color") = "#" + txtMainHeaderText.Text Div7.Style("color") = "#" + txtMainHeaderText.Text Div8.Style("color") = "#" + txtMainHeaderText.Text Div9.Style("color") = "#" + txtMainHeaderText.Text Div10.Style("color") = "#" + txtMainHeaderText.Text Div11.Style("color") = "#" + txtMainHeaderText.Text Div12.Style("color") = "#" + txtMainHeaderText.Text Div13.Style("color") = "#" + txtMainHeaderText.Text Div14.Style("color") = "#" + txtMainHeaderText.Text Div15.Style("color") = "#" + txtMainHeaderText.Text Div16.Style("color") = "#" + txtMainHeaderText.Text Div17.Style("color") = "#" + txtMainHeaderText.Text Div18.Style("color") = "#" + txtMainHeaderText.Text Div19.Style("color") = "#" + txtMainHeaderText.Text Div20.Style("color") = "#" + txtMainHeaderText.Text popupNavDiv.Style("color") = "#" + txtMainHeaderText.Text popupNavDiv2.Style("color") = "#" + txtMainHeaderText.Text Response.SetCookie(MainHeaderTextcookie) End Sub Public Sub PopulateColorDropDownMain() Dim names() As String = System.Enum.GetNames(GetType(System.Drawing.KnownColor)) Dim values As Array = System.Enum.GetValues(GetType(System.Drawing.KnownColor)) For i As Integer = 0 To names.Length - 1 If Not System.Drawing.Color.FromKnownColor(values(i)).IsSystemColor Then Dim item As New ListItem(names(i), values(i).ToString) Me.ddMainColors.Items.Add(item) End If Next End Sub Private Sub MainSubheader() Dim MainSubheadercookie As New HttpCookie("MainSubheader") MainSubheadercookie.Value = ddMainColors.SelectedItem.Text MainSubheadercookie.Expires = DateAdd(DateInterval.Year, 1, Now()) dgRecentCompanies.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgRecentContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) 'dgReminder.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgTask.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgCandidates.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgCandidatesProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) 'dgContracts.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgDashCanPros.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgJO.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgProspectDashBoard.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgSearchResults.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgAllContacts.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgAllProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) dgCompProspects.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) gvCompTask.HeaderStyle.BackColor = System.Drawing.Color.FromName(ddMainColors.SelectedItem.Text) Response.SetCookie(MainSubheadercookie) End Sub Private Sub MainBackColor() Dim MainBackColorcookie As New HttpCookie("MainBackColor") MainBackColorcookie.Value = txtMainBack.Text MainBackColorcookie.Expires = DateAdd(DateInterval.Year, 1, Now()) TaskDashboarddiv.Style("background-color") = "#" + txtMainBack.Text CandidateProsDashboard.Style("background-color") = "#" + txtMainBack.Text ProspectsDashboard.Style("background-color") = "#" + txtMainBack.Text RecentlyAddedContacts.Style("background-color") = "#" + txtMainBack.Text RecentlyAddedCompanies.Style("background-color") = "#" + txtMainBack.Text RemindersDashBoard.Style("background-color") = "#" + txtMainBack.Text ColorScheme.Style("background-color") = "#" + txtMainBack.Text AllContacts.Style("background-color") = "#" + txtMainBack.Text ViewProspects.Style("background-color") = "#" + txtMainBack.Text ViewAllCandidates.Style("background-color") = "#" + txtMainBack.Text AllCandidatesProspects.Style("background-color") = "#" + txtMainBack.Text AddContacts.Style("background-color") = "#" + txtMainBack.Text SearchContacts.Style("background-color") = "#" + txtMainBack.Text AddCanRes.Style("background-color") = "#" + txtMainBack.Text AddCanMan.Style("background-color") = "#" + txtMainBack.Text AddCanPros.Style("background-color") = "#" + txtMainBack.Text CanSets.Style("background-color") = "#" + txtMainBack.Text AdvancedCanSearch.Style("background-color") = "#" + txtMainBack.Text ViewJO.Style("background-color") = "#" + txtMainBack.Text AddNewJO.Style("background-color") = "#" + txtMainBack.Text JOSets.Style("background-color") = "#" + txtMainBack.Text JOSearch.Style("background-color") = "#" + txtMainBack.Text AddCompanies.Style("background-color") = "#" + txtMainBack.Text divCompanies.Style("background-color") = "#" + txtMainBack.Text divCompaniesInfo.Style("background-color") = "#" + txtMainBack.Text divCompaniesContact.Style("background-color") = "#" + txtMainBack.Text containerfotTab.Style("background-color") = "#" + txtMainBack.Text tab1.Style("background-color") = "#" + txtMainBack.Text tab2.Style("background-color") = "#" + txtMainBack.Text tab3.Style("background-color") = "#" + txtMainBack.Text tab4.Style("background-color") = "#" + txtMainBack.Text pnlAddEdit.Style("background-color") = "#" + txtMainBack.Text pnlAddEdit2.Style("background-color") = "#" + txtMainBack.Text pnlAddEdit4.Style("background-color") = "#" + txtMainBack.Text Response.SetCookie(MainBackColorcookie) End Sub Private Sub BindJOGridContacts() Dim ds As DataSet Dim dv As DataView Dim oJobDAO As New JobOrderDAO Dim oExpDAO As New ExpensesDAO ds = DAO.ConvertDataReaderToDataSet(oJobDAO.GetJobOrderByContactID(Session("contactId"))) dv = ds.Tables(0).DefaultView dv.Sort = "DateEntered desc" With dgJobOrders .DataSource = dv .DataBind() End With End Sub Private Sub BindHireGrid() Dim ds As DataSet Dim dv As DataView Dim oHireDAO As New ConsultantDAO ds = DAO.ConvertDataReaderToDataSet(oHireDAO.GetConsultantByContactID(Session("contactId"))) dv = ds.Tables(0).DefaultView dv.Sort = "AssignmentStart desc" With dgHires .DataSource = dv .DataBind() End With End Sub Private Sub BindInterviewGrid() Dim ds As DataSet Dim dv As DataView Dim oJobDAO As New JobOrderDAO ds = DAO.ConvertDataReaderToDataSet(oJobDAO.GetJobOrderByInterviewerID(Session("contactId"))) dv = ds.Tables(0).DefaultView dv.Sort = "InterviewDate desc" With dgInterview .DataSource = dv .DataBind() End With End Sub Protected Sub dgInterview_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgInterview.ItemCommand Dim oActDAO As ActivitiesDAO Dim oInterview As New Interview Dim oInterviewDAO As New InterviewDAO Dim oSubmission As New Submission Dim oSubmissionDAO As New SubmissionDAO If e.CommandName = "Calendar" Then Try oActDAO = New ActivitiesDAO oInterview = oInterviewDAO.RetrieveInterviewRecordByInterviewID(dgInterview.DataKeys(e.Item.ItemIndex)) oSubmission = oSubmissionDAO.RetrieveSubmission(oInterview.iSubmissionRecordID) Dim oComp As New Company Dim oCompDAO As New CompanyDAO oComp = oCompDAO.RetrieveCompany(companyID) oActDAO.GenerateInterviewAppt(oInterview.sActivity, Constants.sAppointmentPath, oInterview.dtInterviewDate, Session("LoggedInUserEmail"), Session("LoggedInUserID"), oSubmission.iCandidateID, oComp.sCompanyName) Utilities.MessageLabel.DisplayMessageLabel(infoLabel, "Calendar entry sent successfully!", Utilities.MessageLabel.CONFIRM) Catch ex As Exception oErr.ThrowGeneralError(infoLabel, ex, Session("LoggedInUserID")) End Try End If End Sub Protected Sub ViewHireForm(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) If Page.IsPostBack Then popupJO.Show() 'CompanyInfoPopup.Hide() Me.IframeJobOrders.Attributes("src") = "ConsultingHireForm.aspx?id=" & dgHires.DataKeys(e.Item.ItemIndex) End If End Sub End Class