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("
" & 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 & "
Additional Notes:
" & txtAdditional.Text & "