/// <summary> /// Bind Grid /// </summary> private void BindGrid() { int pageIndex = 1; int pageSize = AspNetPager1.PageSize; if (AspNetPager1.CurrentPageIndex > 0) { pageIndex = AspNetPager1.CurrentPageIndex; } string queryCondition = GenOrgQueryCondition(); int recordCount = 0; DataSet ds = null; try { ProspectEmployment bll = new ProspectEmployment(); ds = bll.GetProspectEmployment(pageSize, pageIndex, queryCondition, out recordCount, OrderName, OrderType); } catch (Exception exception) { LPLog.LogMessage(exception.Message); } AspNetPager1.PageSize = pageSize; AspNetPager1.RecordCount = recordCount; gridList.DataSource = ds; gridList.DataBind(); }
private void InitPage(int employmentId) { // bind the controls in the page and datasource LPWeb.BLL.ProspectEmployment bll = new ProspectEmployment(); DataTable employmentInfo = bll.GetEmployment(employmentId); if (employmentInfo == null || employmentInfo.Rows.Count == 0) { return; } txtEmployer.Text = employmentInfo.Rows[0]["EmploymentName"] == null ? string.Empty : employmentInfo.Rows[0]["EmploymentName"].ToString(); txtPisition.Text = employmentInfo.Rows[0]["Position"] == null ? string.Empty : employmentInfo.Rows[0]["Position"].ToString(); checkSelf.Checked = employmentInfo.Rows[0]["SelfEmployed"] != null && string.Equals(employmentInfo.Rows[0]["SelfEmployed"].ToString(), "true", StringComparison.CurrentCultureIgnoreCase); txtStart.Text = (employmentInfo.Rows[0].IsNull("StartMonth") || employmentInfo.Rows[0].IsNull("StartYear")) ? string.Empty : employmentInfo.Rows[0]["StartMonth"].ToString() + "/" + employmentInfo.Rows[0]["StartYear"].ToString(); txtEnd.Text = (employmentInfo.Rows[0].IsNull("EndMonth") || employmentInfo.Rows[0].IsNull("EndYear")) ? string.Empty : employmentInfo.Rows[0]["EndMonth"].ToString() + "/" + employmentInfo.Rows[0]["EndYear"].ToString(); txtSalary.Text = employmentInfo.Rows[0]["Salary"] == null ? string.Empty : employmentInfo.Rows[0]["Salary"].ToString(); txtPhone.Text = employmentInfo.Rows[0]["Phone"] == null ? string.Empty : employmentInfo.Rows[0]["Phone"].ToString(); txtYearsExp.Text = employmentInfo.Rows[0]["YearsOnWork"] == null ? string.Empty : employmentInfo.Rows[0]["YearsOnWork"].ToString(); txtAddress.Text = employmentInfo.Rows[0]["Address"] == null ? string.Empty : employmentInfo.Rows[0]["Address"].ToString(); txtCity.Text = employmentInfo.Rows[0]["City"] == null ? string.Empty : employmentInfo.Rows[0]["City"].ToString(); if (employmentInfo.Rows[0]["State"] == null) { ddlState.SelectedIndex = -1; } else { ddlState.SelectedValue = employmentInfo.Rows[0]["State"].ToString(); } txtZip.Text = employmentInfo.Rows[0]["Zip"] == null ? string.Empty : employmentInfo.Rows[0]["Zip"].ToString(); txtBusinessType.Text = employmentInfo.Rows[0]["BusinessType"] == null ? string.Empty : employmentInfo.Rows[0]["BusinessType"].ToString(); checkVerify.Checked = employmentInfo.Rows[0]["VerifyYourTaxes"] != null && string.Equals(employmentInfo.Rows[0]["VerifyYourTaxes"].ToString(), "true", StringComparison.CurrentCultureIgnoreCase); hfdBranchContractId.Value = employmentInfo.Rows[0]["ContactBranchId"] == null ? string.Empty : employmentInfo.Rows[0]["ContactBranchId"].ToString(); }
private void InitIncomeAndEmploymentInfo(int iBorrowerID) { #region 加载 Income and Employment #region 加载Employment信息 ProspectEmployment ProspectEmploymentMgr = new ProspectEmployment(); DataTable EmploymentInfo = ProspectEmploymentMgr.GetList("1=1 and ContactId=" + iBorrowerID + " order by EmplId desc").Tables[0]; if (EmploymentInfo.Rows.Count > 0) { this.BorrowerInfo_Employment = EmploymentInfo.Copy(); } #endregion #region 加载Income信息 ProspectIncome ProspectIncomeMgr = new ProspectIncome(); DataTable IncomeInfo = ProspectIncomeMgr.GetList("1=1 and ContactId=" + iBorrowerID + " order by ProspectIncomeId desc").Tables[0]; if (IncomeInfo.Rows.Count > 0) { this.BorrowerInfo_Income = IncomeInfo.Copy(); } #endregion #region 加载Assets信息 ProspectAssets ProspectAssetsMgr = new ProspectAssets(); DataTable AssetsInfo = ProspectAssetsMgr.GetList("1=1 and ContactId=" + iBorrowerID + " order by ProspectAssetId desc").Tables[0]; if (AssetsInfo.Rows.Count > 0) { this.BorrowerInfo_Assets = AssetsInfo.Copy(); } #endregion #endregion }
/// <summary> /// Handles the Click event of the btnRemove 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 btnRemove_Click(object sender, EventArgs e) { string employeeIDs = hdnEmplIds.Value; string errMsg = string.Empty; try { ProspectEmployment bll = new ProspectEmployment(); bll.DeleteList(employeeIDs); } catch (Exception ex) { errMsg = ex.Message; } if (errMsg == string.Empty) { PageCommon.WriteJsEnd(this, "Removed successfully.", PageCommon.Js_RefreshSelf); } else { PageCommon.WriteJsEnd(this, errMsg, PageCommon.Js_RefreshSelf); } }
private void BindContact() { string strWhere = " 1>0"; if (sPageFrom == "LeadDetail") { strWhere += " AND FileID = '" + sFileID + "' "; ddlContacts.Enabled = true; } else { strWhere += " AND ContactID = '" + sContactID + "' "; ddlContacts.Enabled = false; } try { ProspectEmployment bll = new ProspectEmployment(); DataSet ds = bll.ProspectContacts(strWhere); ddlContacts.DataSource = ds; ddlContacts.DataBind(); } catch { } }
/// <summary> /// /// </summary> /// <param name="iContactId"></param> /// <param name="sCompanyName"></param> /// <param name="bSelfEmployed"></param> /// <param name="sPosition"></param> /// <param name="sProfession"></param> /// <param name="sYearsInField"></param> /// <param name="sStartYear"></param> /// <param name="sStartMonth"></param> /// <param name="sEndYear"></param> /// <param name="sEndMonth"></param> private void UpdateProspectEmployment(int iEmploymentID, string sCompanyName, bool bSelfEmployed, string sPosition, string sProfession, string sYearsInField, string sStartYear, string sStartMonth, string sEndYear, string sEndMonth) { #region update ProspectEmployment ProspectEmployment ProspectEmploymentMgr = new ProspectEmployment(); LPWeb.Model.ProspectEmployment ProspectEmploymentModel = ProspectEmploymentMgr.GetModel(iEmploymentID); ProspectEmploymentModel.CompanyName = sCompanyName; ProspectEmploymentModel.SelfEmployed = bSelfEmployed; ProspectEmploymentModel.Position = sPosition; ProspectEmploymentModel.BusinessType = sProfession; if (sYearsInField == string.Empty) { ProspectEmploymentModel.YearsOnWork = null; } else { ProspectEmploymentModel.YearsOnWork = Convert.ToDecimal(sYearsInField); } if (sStartYear == string.Empty) { ProspectEmploymentModel.StartYear = null; } else { ProspectEmploymentModel.StartYear = Convert.ToDecimal(sStartYear); } if (sStartMonth == string.Empty) { ProspectEmploymentModel.StartMonth = null; } else { ProspectEmploymentModel.StartMonth = Convert.ToDecimal(sStartMonth); } if (sEndYear == string.Empty) { ProspectEmploymentModel.EndYear = null; } else { ProspectEmploymentModel.EndYear = Convert.ToDecimal(sEndYear); } if (sEndMonth == string.Empty) { ProspectEmploymentModel.EndMonth = null; } else { ProspectEmploymentModel.EndMonth = Convert.ToDecimal(sEndMonth); } ProspectEmploymentMgr.Update(ProspectEmploymentModel); #endregion }