protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (ddlState.Items.Count <= 0) { USStates.Init(ddlState); } BindServiceTypes(); } }
protected void Page_Load(object sender, EventArgs e) { #region 校验页面参数 // CloseDialogCodes bool bIsValid = PageCommon.ValidateQueryString(this, "CloseDialogCodes", QueryStringType.String); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.parent.location.href=window.parent.location.href"); } this.sCloseDialogCodes = this.Request.QueryString["CloseDialogCodes"].ToString() + ";"; // RefreshCodes bIsValid = PageCommon.ValidateQueryString(this, "RefreshCodes", QueryStringType.String); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.parent.location.href=window.parent.location.href"); } this.sRefreshCodes = this.Request.QueryString["RefreshCodes"].ToString() + ";"; #endregion string sFileID = this.Request.QueryString["FileID"]; string sContactID = this.Request.QueryString["ContactID"]; if (PageCommon.IsID(sFileID) == false) { iFileID = 0; } else { iFileID = int.Parse(sFileID); } if (PageCommon.IsID(sContactID) == false) { iContactID = 0; //return; } else { iContactID = int.Parse(sContactID); } hfFileID.Value = iFileID.ToString(); if (!IsPostBack) { USStates.Init(ddlState); BindDLL(); FillLabels(); } }
protected void Page_Load(object sender, EventArgs e) { #region 检查页面参数 // CloseDialogCodes bool bIsValid = PageCommon.ValidateQueryString(this, "CloseDialogCodes", QueryStringType.String); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.parent.location.href=window.parent.location.href"); } this.sCloseDialogCodes = this.Request.QueryString["CloseDialogCodes"].ToString() + ";"; // ContactID bIsValid = PageCommon.ValidateQueryString(this, "ContactID", QueryStringType.ID); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", this.sCloseDialogCodes); } // when update, verify the EmployID if (!string.Equals(this.Request.QueryString["Action"], "Add", StringComparison.InvariantCultureIgnoreCase)) { // EmployID bIsValid = PageCommon.ValidateQueryString(this, "EmployID", QueryStringType.ID); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", this.sCloseDialogCodes); } } #endregion var strContractId = this.Request.QueryString["ContactID"]; this.hfdContractId.Value = strContractId; if (this.IsPostBack == false) { int employmentId = -1; var strEmploymentId = this.Request.QueryString["EmployID"]; employmentId = string.IsNullOrEmpty(strEmploymentId) ? -1 : Convert.ToInt32(strEmploymentId); this.hfdEmploymentId.Value = employmentId.ToString(); // initialize the dropdownlist USStates.Init(ddlState); if (employmentId == -1) { return; } InitPage(employmentId); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { try { //权限验证 var loginUser = new LoginUser(); if (!loginUser.userRole.CompanySetup) { //若当前没有权限,则跳转到个人设定页面 Response.Redirect("PersonalizationSettings.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } try { if (!Page.IsPostBack) { if (ddlState.Items.Count <= 0) USStates.Init(ddlState); if (Request.UrlReferrer != null) { this.btnCancel.PostBackUrl = Request.UrlReferrer.ToString(); } GetInitData(); InitGroupAccess(); if (modCompanyGeneral != null) { SetDataToUI(); } } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } }
public void DataBind() { BLL.ServiceTypes bllServiceType = new BLL.ServiceTypes(); ddlServiceType.DataSource = bllServiceType.GetList(" [Enabled] = 1 "); ddlServiceType.DataTextField = "Name"; ddlServiceType.DataValueField = "ServiceTypeId"; ddlServiceType.DataBind(); var item = new ListItem("All ", "0") { Selected = true }; ddlServiceType.Items.Insert(0, item); if (ddlState.Items.Count <= 0) { USStates.Init(ddlState); } }
protected void Page_Load(object sender, EventArgs e) { try { CurrentUser = new LoginUser(); //loginUser.ValidatePageVisitPermission("LoanSetup"); if (CurrentUser.userRole.ContactMgmt.ToString().IndexOf('1') == -1) { Response.Redirect("../Unauthorize.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } if (Request.QueryString["FileID"] != null) // 如果有FileID { string sFileID = Request.QueryString["FileID"]; if (PageCommon.IsID(sFileID) == false) { //PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } CurrentFileId = Convert.ToInt32(sFileID); } if (!IsPostBack) { USStates.Init(ddlState); BindServiceType(); } }
protected void Page_Load(object sender, EventArgs e) { try { CurrentUser = new LoginUser(); //loginUser.ValidatePageVisitPermission("LoanSetup"); //not have Contact Modify Power if (CurrentUser.userRole.ContactMgmt.ToString().IndexOf('2') == -1) { Response.Redirect("../Unauthorize.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } if (Request.QueryString["FileID"] != null) // 如果有FileID { string sFileID = Request.QueryString["FileID"]; if (PageCommon.IsID(sFileID) == false) { //PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } CurrentFileId = Convert.ToInt32(sFileID); } if (Request.QueryString["ContactID"] != null) // 如果有ContactID { string sContactID = Request.QueryString["ContactID"]; sContactID = sContactID.Replace("Contract", ""); string[] tmpIds = sContactID.Split("_".ToCharArray()); if (tmpIds.Length == 2) { iContactID = Convert.ToInt32(tmpIds[0]); iContactRoleID = Convert.ToInt32(tmpIds[1]); } else { iContactID = 0; iContactRoleID = 0; } } else { iContactID = 0; } if (iContactID == 0) { return; } hdnContactID.Value = iContactID.ToString(); if (!IsPostBack) { USStates.Init(ddlState); BindServiceType(); BindContact(); } }
protected void Page_Load(object sender, EventArgs e) { try { //LoginUser loginUser = new LoginUser(); //loginUser.ValidatePageVisitPermission("BranchSetup"); //权限验证 var loginUser = new LoginUser(); if (!loginUser.userRole.CompanySetup) { Response.Redirect("../Unauthorize.aspx"); return; } } catch (Exception exception) { LPLog.LogMessage(exception.Message); } if (!IsPostBack) { if (ddlState.Items.Count <= 0) { USStates.Init(ddlState); } BindBranchNames(); LPWeb.BLL.Company_General cG = new Company_General(); this.hdnMarketingEnabled.Value = "0"; if (cG.CheckMarketingEnabled()) { this.hdnMarketingEnabled.Value = "1"; } string sErrorMsg = "Failed to load current page: invalid GroupID."; string sReturnPage = "BranchSetup.aspx"; if (this.Request.QueryString["BranchID"] != null) // 如果有GroupID { string sBranchID = this.Request.QueryString["BranchID"].ToString(); if (PageCommon.IsID(sBranchID) == false) { PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'"); } this.iBranchID = Convert.ToInt32(sBranchID); } else // 如果没有BranchID,初始化时 { // 取第一个BranchID的ID if (ddlBranchName.Items.Count > 0) { this.iBranchID = Convert.ToInt32(ddlBranchName.Items[0].Value); } } if (!branchManager.ExistBranch(iBranchID)) { return; } ViewState["branchid"] = iBranchID.ToString(); this.ddlBranchName.SelectedValue = iBranchID.ToString(); LoadControls(); } iBranchID = int.Parse(ViewState["branchid"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { #region 检查页面参数 // CloseDialogCodes bool bIsValid = PageCommon.ValidateQueryString(this, "CloseDialogCodes", QueryStringType.String); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.parent.location.href=window.parent.location.href"); } this.sCloseDialogCodes = this.Request.QueryString["CloseDialogCodes"].ToString() + ";"; // RefreshCodes bIsValid = PageCommon.ValidateQueryString(this, "RefreshCodes", QueryStringType.String); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.parent.location.href=window.parent.location.href"); } this.sRefreshCodes = this.Request.QueryString["RefreshCodes"].ToString() + ";"; if (PageCommon.ValidateQueryString(this, "RefreshCodes", QueryStringType.String)) { this.sRefreshTabCodes = this.Request.QueryString["RefreshTab"].ToString().Trim() == "" ? "" : (this.Request.QueryString["RefreshTab"].ToString().Trim() + ";"); } // ProspectID bIsValid = PageCommon.ValidateQueryString(this, "ProspectID", QueryStringType.ID); if (bIsValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", this.sCloseDialogCodes); } this.iProspectID = Convert.ToInt32(this.Request.QueryString["ProspectID"]); #endregion //权限验证 if (_curLoginUser.userRole.Prospect.ToString().IndexOf('H') == -1) // UpdatePoint { btnUpdatePoint.Enabled = false; } #region 加载Contact信息 Contacts ContactManager = new Contacts(); DataTable ContactInfo = null; try { ContactInfo = ContactManager.GetContactInfo(this.iProspectID); } catch (Exception ex) { string sExMsg = string.Format("Exception happened when get contact info (ContactID={0}): {1}", this.iProspectID, ex.Message); LPLog.LogMessage(LogType.Logerror, ex.Message); PageCommon.WriteJsEnd(this, "Exception happened when get contact info.", this.sCloseDialogCodes); } if (ContactInfo.Rows.Count == 0) { PageCommon.WriteJsEnd(this, "Invalid contact id.", this.sCloseDialogCodes); } #endregion #region 加载Prospect信息 Prospect ProspectManager = new Prospect(); DataTable ProspectInfo = null; try { ProspectInfo = ProspectManager.GetProspectInfo(this.iProspectID); } catch (Exception ex) { string sExMsg = string.Format("Exception happened when get prospect info (ContactID={0}): {1}", this.iProspectID, ex.Message); LPLog.LogMessage(LogType.Logerror, ex.Message); PageCommon.WriteJsEnd(this, "Exception happened when get prospect info.", this.sCloseDialogCodes); } if (ProspectInfo.Rows.Count == 0) { PageCommon.WriteJsEnd(this, "Invalid prospect id.", this.sCloseDialogCodes); } #region 加载Create By Users UserManager = new Users(); string sCreatedBy = ProspectInfo.Rows[0]["CreatedBy"].ToString(); int iCreatedBy = 0; //Convert.ToInt32(sCreatedBy); if (sCreatedBy != string.Empty) { iCreatedBy = Convert.ToInt32(sCreatedBy); DataTable CreatedByInfo = UserManager.GetUserInfo(iCreatedBy); if (CreatedByInfo.Rows.Count == 0) { this.lbCreatedBy.Text = string.Empty; } else { this.lbCreatedBy.Text = CreatedByInfo.Rows[0]["LastName"].ToString() + ", " + CreatedByInfo.Rows[0]["FirstName"].ToString(); } } else { this.lbCreatedBy.Text = string.Empty; } #endregion #region 加载Create By string sModifiedBy = ProspectInfo.Rows[0]["ModifiedBy"].ToString(); if (sModifiedBy != string.Empty) { DataTable ModifiedByInfo = UserManager.GetUserInfo(Convert.ToInt32(sModifiedBy)); if (ModifiedByInfo.Rows.Count == 0) { this.lbModifiedBy.Text = string.Empty; } else { this.lbModifiedBy.Text = ModifiedByInfo.Rows[0]["LastName"].ToString() + ", " + ModifiedByInfo.Rows[0]["FirstName"].ToString(); } } else { this.lbModifiedBy.Text = string.Empty; } #endregion #endregion // Old Status this.hdnOldStatus.Value = ProspectInfo.Rows[0]["Status"].ToString(); if (this.IsPostBack == false) { USStates.Init(ddlState); #region 加载Loan Officer列表 DataTable LoanOfficerList = this.GetLoanOfficerList(iCreatedBy); this.ddlLoanOfficer.DataSource = LoanOfficerList; this.ddlLoanOfficer.DataBind(); #endregion #region 加载Lead Source列表 Company_Lead_Sources LeadSourceManager = new Company_Lead_Sources(); DataTable LeadSourceList = LeadSourceManager.GetList("1=1 order by LeadSource").Tables[0]; DataRow NewLeadSourceRow = LeadSourceList.NewRow(); NewLeadSourceRow["LeadSourceID"] = DBNull.Value; NewLeadSourceRow["LeadSource"] = "-- select --"; LeadSourceList.Rows.InsertAt(NewLeadSourceRow, 0); this.ddlLeadSource.DataSource = LeadSourceList; this.ddlLeadSource.DataBind(); #endregion #region 绑定Prospect数据 // Loan Officer this.ddlLoanOfficer.SelectedValue = ProspectInfo.Rows[0]["LoanOfficer"].ToString(); hfLoanOfficer.Value = ProspectInfo.Rows[0]["LoanOfficer"].ToString(); this.txtRefCode.Text = ProspectInfo.Rows[0]["ReferenceCode"].ToString(); this.ddlStatus.SelectedValue = ProspectInfo.Rows[0]["Status"].ToString(); ListItem item = this.ddlCreditRanking.Items.FindByValue(string.Format("{0}", ProspectInfo.Rows[0]["CreditRanking"])); if (null != item) { this.ddlCreditRanking.ClearSelection(); item.Selected = true; } item = this.ddlPreferredContact.Items.FindByValue(string.Format("{0}", ProspectInfo.Rows[0]["PreferredContact"])); if (null != item) { this.ddlPreferredContact.ClearSelection(); item.Selected = true; } this.ddlLeadSource.SelectedValue = ProspectInfo.Rows[0]["LeadSource"].ToString(); this.lbCreatedOn.Text = ProspectInfo.Rows[0]["Created"].ToString(); this.lbModifiedOn.Text = ProspectInfo.Rows[0]["Modifed"].ToString(); //Get referral contact name int iReferralId = 0; if (ProspectInfo.Rows[0]["Referral"].ToString() != "" && int.TryParse(ProspectInfo.Rows[0]["Referral"].ToString(), out iReferralId)) { this.txbReferral.Text = ContactManager.GetContactName(iReferralId); this.hdnReferralID.Value = iReferralId.ToString(); } #endregion #region 绑定Contact数据 this.txtFirstName.Text = ContactInfo.Rows[0]["FirstName"].ToString(); this.txtMiddleName.Text = ContactInfo.Rows[0]["MiddleName"].ToString(); this.txtLastName.Text = ContactInfo.Rows[0]["LastName"].ToString(); this.ddlTitle.SelectedValue = ContactInfo.Rows[0]["Title"].ToString(); this.txtGenerationCode.Text = ContactInfo.Rows[0]["GenerationCode"].ToString(); this.txtSSN.Text = ContactInfo.Rows[0]["SSN"].ToString(); this.txtHomePhone.Text = ContactInfo.Rows[0]["HomePhone"].ToString(); this.txtCellPhone.Text = ContactInfo.Rows[0]["CellPhone"].ToString(); this.txtBizPhone.Text = ContactInfo.Rows[0]["BusinessPhone"].ToString(); this.txtFax.Text = ContactInfo.Rows[0]["Fax"].ToString(); this.txtAddress.Text = ContactInfo.Rows[0]["MailingAddr"].ToString(); this.txtCity.Text = ContactInfo.Rows[0]["MailingCity"].ToString(); this.ddlState.SelectedValue = ContactInfo.Rows[0]["MailingState"].ToString(); this.txtZip.Text = ContactInfo.Rows[0]["MailingZip"].ToString(); this.txtEmail.Text = ContactInfo.Rows[0]["Email"].ToString(); if (ContactInfo.Rows[0]["DOB"] == DBNull.Value) { this.txtDOB.Text = string.Empty; } else { this.txtDOB.Text = Convert.ToDateTime(ContactInfo.Rows[0]["DOB"]).ToShortDateString(); } this.txtExperianScore.Text = ContactInfo.Rows[0]["Experian"].ToString(); this.txtTransUnitScore.Text = ContactInfo.Rows[0]["TransUnion"].ToString(); this.txtEquifaxScore.Text = ContactInfo.Rows[0]["Equifax"].ToString(); #endregion } }