public static bool Apply_Insert(ApplyingRecord p, ref string err) { string newID = SqlServerDAL.DA_Common.GetNewID_ByDate(DateTime.Today.ToString("yyyyMMdd"), "T_ApplyRecord", "sApplyID", 5, "A", 0); string sql = "insert into T_ApplyRecord(sApplyID , sProductCode , sCustomerName , sCustomerPhone , sCustomerEmail , sProductType , sCarProperty , dCarCustomerMonthlySalary , sCarPurchasingPeriod , sHouseType , sHouseIncome , sHouseLocalorNot , sHouseNew , sFirmType , dFirmAccountBill , sFirmAge , sFirmProperty , sPerslEmployment , sPerslYoBirth , sPerslSalaryType , sPerslWorkingAge , sPerslCreditOwner , sPerslCardNo , sPerslCreditAllowance , sPerslCreditDue , sPerslLoan , sPerslLoanDue ,sPerslLoanSucc, dtCreatTime , sCaseState , sIPaddress) values ( " + "'" + newID + "'" + ",'" + p.ProductCode + "'" + ",'" + p.CustomerName + "'" + ",'" + p.CustomerPhone + "'" + ",'" + p.CustomerEmail + "'" + ",'" + p.ProductType + "'" + ",'" + (p.CarProperty.Split(',').Length > 1 ? p.CarProperty.Split(',')[0] : p.CarProperty) + "'" + "," + p.CarCustomerMonthlySalary.ToString() + ",'" + (p.CarPurchasingPeriod.Split(',').Length > 1 ? p.CarPurchasingPeriod.Split(',')[0] : p.CarPurchasingPeriod) + "'" + ",'" + (p.HouseType.Split(',').Length > 1 ? p.HouseType.Split(',')[0] : p.HouseType) + "'" + ",'" + p.HouseIncome + "'" + ",'" + (p.HouseLocalorNot.Split(',').Length > 1 ? p.HouseLocalorNot.Split(',')[0] : p.HouseLocalorNot) + "'" + ",'" + (p.HouseNew.Split(',').Length > 1 ? p.HouseNew.Split(',')[0] : p.HouseNew) + "'" + ",'" + (p.FirmType.Split(',').Length > 1 ? p.FirmType.Split(',')[0] : p.FirmType) + "'" + "," + p.FirmAccountBill.ToString() + ",'" + (p.FirmAge.Split(',').Length > 1 ? p.FirmAge.Split(',')[0] : p.FirmAge) + "'" + ",'" + (p.FirmProperty.Split(',').Length > 1 ? p.FirmProperty.Split(',')[0] : p.FirmProperty) + "'" + ",'" + (p.PerslEmployment.Split(',').Length > 1 ? p.PerslEmployment.Split(',')[0] : p.PerslEmployment) + "'" + ",'" + p.PerslYoBirth + "'" + ",'" + (p.PerslSalaryType.Split(',').Length > 1 ? p.PerslSalaryType.Split(',')[0] : p.PerslSalaryType) + "'" + ",'" + (p.PerslWorkingAge.Split(',').Length > 1 ? p.PerslWorkingAge.Split(',')[0] : p.PerslWorkingAge) + "'" + ",'" + (p.PerslCreditOwner.Split(',').Length > 1 ? p.PerslCreditOwner.Split(',')[0] : p.PerslCreditOwner) + "'" + ",'" + (p.PerslCardNo.Split(',').Length > 1 ? p.PerslCardNo.Split(',')[0] : p.PerslCardNo) + "'" + ",'" + (p.PerslCreditAllowance.Split(',').Length > 1 ? p.PerslCreditAllowance.Split(',')[0] : p.PerslCreditAllowance) + "'" + ",'" + (p.PerslCreditDue.Split(',').Length > 1 ? p.PerslCreditDue.Split(',')[0] : p.PerslCreditDue) + "'" + ",'" + (p.PerslLoan.Split(',').Length > 1 ? p.PerslLoan.Split(',')[0] : p.PerslLoan) + "'" + ",'" + (p.PerslLoanDue.Split(',').Length > 1 ? p.PerslLoanDue.Split(',')[0] : p.PerslLoanDue) + "'" + ",'" + (p.PerslLoanSucc.Split(',').Length > 1 ? p.PerslLoanSucc.Split(',')[0] : p.PerslLoanSucc) + "'" + ",GetDate()" + ",'" + p.CaseState + "'" + ",'" + p.IPaddress + "'" + ")"; SqlServerDAL.DA_Adapter da = new SqlServerDAL.DA_Adapter(); int val = da.Common_Excute(sql, ref err); if (val == 0) { return true; } else { return false; } }
public ActionResult Carloan1(CarLoanStep1 c, FormCollection values) { if (ModelState.IsValid) { string productcode = values["productcode"].ToString(); string producttype = values["producttype"].ToString(); if (Session[BizCommon.g_SessionName_ApplyProject] != null) { //若session中已经存在申请对象,则将本步骤所取得的值赋到session中的对象上; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).CarCustomerMonthlySalary = c.CarCustomerMonthlySalary; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).CarProperty = c.CarProperty; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).CarPurchasingPeriod = c.CarPurchasingPeriod; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductCode = productcode; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductType = producttype; return View("Carloan2"); } else { //否则,新创建一个申请对象,并将本步骤取得值赋到新的对象上,然后将对象放到session中; ApplyingRecord p = new ApplyingRecord(); p.CarCustomerMonthlySalary = c.CarCustomerMonthlySalary; p.CarProperty = c.CarProperty; p.CarPurchasingPeriod = c.CarPurchasingPeriod; p.ProductCode = productcode; p.ProductType = producttype; //第一步创建project类放到session中 if (Session[BizCommon.g_SessionName_ApplyProject] != null) Session[BizCommon.g_SessionName_ApplyProject] = null; Session[BizCommon.g_SessionName_ApplyProject] = p; return View("Carloan2"); } } //万一发生异常时,将执行以下代码(即返回第一步页面) //第一步中的下拉选项预加载 ViewBag.CarProperty = BizCommon.GetAA10Items("sCarProperty", "cast(aaa102 as int)"); //车贷-房产 下拉选项 ViewBag.CarPurchasingPeriod = BizCommon.GetAA10Items("sCarPurchasingPeriod", "cast(aaa102 as int)"); //车贷-购车阶段 下拉选项 return View("Carloan1"); }
public ActionResult Purchaseloan2(PurchaseLoanStep2 c) { if (ModelState.IsValid) { if (Session[BizCommon.g_SessionName_ApplyProject] == null) //若Session为空,则返回第一步(这是有可能的,长时间不操作) return View("Purchaseloan1"); if (Session[BizCommon.g_SessionName_ApplyProject] != null) { //若session中已经存在申请对象,则将本步骤所取得的值赋到session中的对象上; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslCardNo = c.PerslCardNo; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslCreditAllowance = c.PerslCreditAllowance; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslCreditDue = c.PerslCreditDue; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslCreditOwner = c.PerslCreditOwner; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslLoan = c.PerslLoan; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslLoanDue = c.PerslLoanDue; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslLoanSucc = c.PerslLoanSucc; return View("Purchaseloan3"); } else { //否则,新创建一个申请对象,并将本步骤取得值赋到新的对象上,然后将对象放到session中; ApplyingRecord p = new ApplyingRecord(); p.PerslCardNo = c.PerslCardNo; p.PerslCreditAllowance = c.PerslCreditAllowance; p.PerslCreditDue = c.PerslCreditDue; p.PerslCreditOwner = c.PerslCreditOwner; p.PerslLoan = c.PerslLoan; p.PerslLoanDue = c.PerslLoanDue; p.PerslLoanSucc = c.PerslLoanSucc; //第一步创建project类放到session中 if (Session[BizCommon.g_SessionName_ApplyProject] != null) Session[BizCommon.g_SessionName_ApplyProject] = null; Session[BizCommon.g_SessionName_ApplyProject] = p; return View("Purchaseloan3"); } } //万一发生异常时,将执行以下代码(即返回第一步页面) //第一步中的下拉选项预加载 ViewBag.PerslCardNo = BizCommon.GetAA10Items("sPerslCardNo", "cast(aaa102 as int)"); ViewBag.PerslCreditOwner = BizCommon.GetAA10Items("sPerslCreditOwner", "cast(aaa102 as int)"); ViewBag.PerslLoan = BizCommon.GetAA10Items("sPerslLoan", "cast(aaa102 as int)"); ViewBag.PerslLoanDue = BizCommon.GetAA10Items("sPerslLoanDue", "cast(aaa102 as int)"); ViewBag.PerslLoanSucc = BizCommon.GetAA10Items("sPerslLoanSucc", "cast(aaa102 as int)"); return View("Purchaseloan2"); }
public ActionResult Purchaseloan1(PurchaseLoanStep1 c, FormCollection values) { if (ModelState.IsValid) { string productcode = values["productcode"].ToString(); string producttype = values["producttype"].ToString(); if (Session[BizCommon.g_SessionName_ApplyProject] != null) { //若session中已经存在申请对象,则将本步骤所取得的值赋到session中的对象上; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslEmployment = c.PerslEmployment; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslSalaryType = c.PerslSalaryType; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslWorkingAge = c.PerslWorkingAge; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslYoBirth = c.PerslYoBirth; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).PerslSalary = c.PerslSalary; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductCode = productcode; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductType = producttype; return View("Purchaseloan2"); } else { //否则,新创建一个申请对象,并将本步骤取得值赋到新的对象上,然后将对象放到session中; ApplyingRecord p = new ApplyingRecord(); p.PerslEmployment = c.PerslEmployment; p.PerslSalaryType = c.PerslSalaryType; p.PerslWorkingAge = c.PerslWorkingAge; p.PerslYoBirth = c.PerslYoBirth; p.PerslSalary = c.PerslSalary; p.ProductCode = productcode; p.ProductType = producttype; p.PerslSalary = c.PerslSalary; //第一步创建project类放到session中 if (Session[BizCommon.g_SessionName_ApplyProject] != null) Session[BizCommon.g_SessionName_ApplyProject] = null; Session[BizCommon.g_SessionName_ApplyProject] = p; return View("Purchaseloan2"); } } //万一发生异常时,将执行以下代码(即返回第一步页面) //第一步中的下拉选项预加载 ViewBag.PerslEmployment = BizCommon.GetAA10Items("sPerslEmployment", "cast(aaa102 as int)"); ViewBag.PerslSalaryType = BizCommon.GetAA10Items("sPerslSalaryType", "cast(aaa102 as int)"); ViewBag.PerslWorkingAge = BizCommon.GetAA10Items("sPerslWorkingAge", "cast(aaa102 as int)"); ViewBag.PerslSalary = BizCommon.GetAA10Items("sPerslSalary", "cast(aaa102 as int)"); return View("Purchaseloan1"); }
public ActionResult Homeloan1(HomeLoanStep1 c, FormCollection values) { if (ModelState.IsValid) { string productcode = values["productcode"].ToString(); string producttype = values["producttype"].ToString(); if (Session[BizCommon.g_SessionName_ApplyProject] != null) { //若session中已经存在申请对象,则将本步骤所取得的值赋到session中的对象上; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).HouseIncome = c.HouseIncome; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).HouseLocalorNot = c.HouseLocalorNot; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).HouseNew = c.HouseNew; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).HouseType = c.HouseType; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductCode = productcode; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductType = producttype; return View("Homeloan2"); } else { //否则,新创建一个申请对象,并将本步骤取得值赋到新的对象上,然后将对象放到session中; ApplyingRecord p = new ApplyingRecord(); p.HouseIncome = c.HouseIncome; p.HouseLocalorNot = c.HouseLocalorNot; p.HouseNew = c.HouseNew; p.HouseType = c.HouseType; p.ProductCode = productcode; p.ProductType = producttype; //第一步创建project类放到session中 if (Session[BizCommon.g_SessionName_ApplyProject] != null) Session[BizCommon.g_SessionName_ApplyProject] = null; Session[BizCommon.g_SessionName_ApplyProject] = p; return View("Homeloan2"); } } //万一发生异常时,将执行以下代码(即返回第一步页面) //第一步中的下拉选项预加载 ViewBag.HouseLocalorNot = BizCommon.GetAA10Items("sHouseLocalorNot", "cast(aaa102 as int)"); ViewBag.HouseNew = BizCommon.GetAA10Items("sHouseNew", "cast(aaa102 as int)"); ViewBag.HouseType = BizCommon.GetAA10Items("sHouseType", "cast(aaa102 as int)"); return View("Homeloan1"); }
public ActionResult Firmloan1(FirmLoanStep1 c, FormCollection values) { if (ModelState.IsValid) { string productcode = values["productcode"].ToString(); string producttype = values["producttype"].ToString(); if (Session[BizCommon.g_SessionName_ApplyProject] != null) { //若session中已经存在申请对象,则将本步骤所取得的值赋到session中的对象上; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).FirmAccountBill = c.FirmAccountBill; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).FirmAge = c.FirmAge; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).FirmProperty = c.FirmProperty; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).FirmType = c.FirmType; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductCode = productcode; (Session[BizCommon.g_SessionName_ApplyProject] as ApplyingRecord).ProductType = producttype; return View("Firmloan2"); } else { //否则,新创建一个申请对象,并将本步骤取得值赋到新的对象上,然后将对象放到session中; ApplyingRecord p = new ApplyingRecord(); p.FirmAccountBill = c.FirmAccountBill; p.FirmAge = c.FirmAge; p.FirmProperty = c.FirmProperty; p.FirmType = c.FirmType; p.ProductCode = productcode; p.ProductType = producttype; //第一步创建project类放到session中 if (Session[BizCommon.g_SessionName_ApplyProject] != null) Session[BizCommon.g_SessionName_ApplyProject] = null; Session[BizCommon.g_SessionName_ApplyProject] = p; return View("Firmloan2"); } } //万一发生异常时,将执行以下代码(即返回第一步页面) //第一步中的下拉选项预加载 ViewBag.FirmAge = BizCommon.GetAA10Items("sFirmAge", "cast(aaa102 as int)"); ViewBag.FirmProperty = BizCommon.GetAA10Items("sFirmProperty", "cast(aaa102 as int)"); ViewBag.FirmType = BizCommon.GetAA10Items("sFirmType", "cast(aaa102 as int)"); return View("Firmloan1"); }
CustomModel GetCustomModel() { Message.CustomInfo loginUser = Session["loginedcustom"] as Message.CustomInfo; string sql1 = "select t1.sEmail,t1.sCustomName,t1.sCertState,t1.sSex,t1.dtBirthday,t1.sCellPhone,t1.sOrganID,t1.sWorkYears, " + "t1.sOrganAddress,t1.sOrganDpt,t1.sAddress," + "t2.sOrganName " + " from t_custom t1 " + " left join t_foreignorgan t2 on t1.sorganid=t2.sorganid " + " where t1.sCustomID='" + loginUser.CustomID + "'"; string sql2 = " select t1.sProductCode,t1.sProductName,t1.sOrganID, t1.sProductType, t1.dAnnualRate, t1.sApplyCondition, t1.sRequiredFile, t1.sMemo, t1.sDetails,t1.sRepaymentType,t1.sChars," + "t1.dMoneyTop,t1.dMoneyBottom," + "t1.nTermTop, t1.nTermBottom," + "t1.nGetLoanDays,t1.dServerFeeOnce,t1.dServerFeeMonthly," + " t2.sOrganName, t2.sLogo" + " from T_Product t1" + " left join T_ForeignOrgan t2 on t1.sOrganID=t2.sOrganID" + " where t1.sOrganID='" + loginUser.OrganID + "'"; string sql3 = "select t1.*," + "t2.aaa103 as sProductTypeName " + " from t_applyrecord t1 " + " left join aa10 t2 on t1.sProductType=t2.aaa102 and t2.aaa100='sProductType'" + " inner join t_product t3 on t1.sProductCode=t3.sProductCode and t3.sOrganID='" + loginUser.OrganID + "'"; DA_Adapter da = new DA_Adapter(); DataSet ds = new DataSet(); string err = ""; da.Common_Query_MultiTable(ref ds, sql1, "T_Custom", sql2, "T_Product", sql3, "T_ApplyRecord", ref err); DataRow drCustom = ds.Tables["T_Custom"].Rows[0]; CustomModel m = new CustomModel(); m.CellPhone = drCustom["sCellPhone"] is DBNull ? "" : drCustom["sCellPhone"].ToString(); m.CustomID = loginUser.CustomID; m.CustomName = drCustom["sCustomName"] is DBNull ? "" : drCustom["sCustomName"].ToString(); m.CertState = drCustom["sCertState"] is DBNull ? "" : drCustom["sCertState"].ToString(); m.CertStateDisplay = ToCertState(m.CertState); m.DateOfBirth = drCustom["dtBirthday"] is DBNull ? "" : Convert.ToDateTime(drCustom["dtBirthday"]).ToString("yyyy-MM-dd"); m.Email = drCustom["sEmail"] is DBNull ? "" : drCustom["sEmail"].ToString(); m.Occupation = ""; m.OrganAddress = drCustom["sAddress"] is DBNull ? "" : drCustom["sAddress"].ToString(); m.OrganID = drCustom["sOrganID"] is DBNull ? "" : drCustom["sOrganID"].ToString(); m.OrganName = drCustom["sOrganName"] is DBNull ? "" : drCustom["sOrganName"].ToString(); m.Sex = drCustom["sSex"] is DBNull ? "" : drCustom["sSex"].ToString(); m.WorkingAge = drCustom["sWorkYears"] is DBNull ? "" : drCustom["sWorkYears"].ToString(); m.Address = drCustom["sAddress"] is DBNull ? "" : drCustom["sAddress"].ToString(); m.WorkYears = drCustom["sWorkYears"] is DBNull ? "" : drCustom["sWorkYears"].ToString(); m.OrganDpt = drCustom["sOrganDpt"] is DBNull ? "" : drCustom["sOrganDpt"].ToString(); #region 加载产品列表 DataRow[] listCustomRows; ProductModel p; decimal dYuanMoney = 100000; int term = 12; foreach (DataRow drProduct in ds.Tables["T_Product"].Rows) { listCustomRows = ds.Tables["T_Custom"].Select("sOrganID='" + drCustom["sOrganID"].ToString() + "'"); p = BizCommon.Convert2Product(drProduct, listCustomRows, dYuanMoney, term); m.ProductList.Add(p);//未分页显示。 } #endregion #region 加载申请列表 ApplyingRecord apply; foreach (DataRow drApply in ds.Tables["T_ApplyRecord"].Rows) { apply = new ApplyingRecord(); apply.CarCustomerMonthlySalary = drApply["dCarCustomerMonthlySalary"] is DBNull ? 0 : Convert.ToDecimal(drApply["dCarCustomerMonthlySalary"]); apply.CarProperty = drApply["sCarProperty"] is DBNull ? "" : drApply["sCarProperty"].ToString(); apply.CarPurchasingPeriod = drApply["sCarPurchasingPeriod"] is DBNull ? "" : drApply["sCarPurchasingPeriod"].ToString(); apply.CaseState = drApply["sCaseState"] is DBNull ? "" : drApply["sCaseState"].ToString(); apply.CreatTime = drApply["dtCreatTime"] is DBNull ? "" : drApply["dtCreatTime"].ToString(); apply.CustomerEmail = drApply["sCustomerEmail"] is DBNull ? "" : drApply["sCustomerEmail"].ToString(); apply.CustomerName = drApply["sCustomerName"] is DBNull ? "" : drApply["sCustomerName"].ToString(); apply.CustomerPhone = drApply["sCustomerPhone"] is DBNull ? "" : drApply["sCustomerPhone"].ToString(); apply.FirmAccountBill = drApply["dFirmAccountBill"] is DBNull ? 0 : Convert.ToDecimal(drApply["dFirmAccountBill"]); apply.FirmAge = drApply["sFirmAge"] is DBNull ? "" : drApply["sFirmAge"].ToString(); apply.FirmProperty = drApply["sFirmProperty"] is DBNull ? "" : drApply["sFirmProperty"].ToString(); apply.FirmType = drApply["sFirmType"] is DBNull ? "" : drApply["sFirmType"].ToString(); apply.HouseIncome = drApply["sHouseIncome"] is DBNull ? "" : drApply["sHouseIncome"].ToString(); apply.HouseLocalorNot = drApply["sHouseLocalorNot"] is DBNull ? "" : drApply["sHouseLocalorNot"].ToString(); apply.HouseNew = drApply["sHouseNew"] is DBNull ? "" : drApply["sHouseNew"].ToString(); apply.HouseType = drApply["sFirmType"] is DBNull ? "" : drApply["sFirmType"].ToString(); apply.PerslCardNo = drApply["sPerslCardNo"] is DBNull ? "" : drApply["sPerslCardNo"].ToString(); apply.PerslCreditAllowance = drApply["sPerslCreditAllowance"] is DBNull ? "" : drApply["sPerslCreditAllowance"].ToString(); apply.PerslCreditDue = drApply["sPerslCreditDue"] is DBNull ? "" : drApply["sPerslCreditDue"].ToString(); apply.PerslCreditOwner = drApply["sPerslCreditOwner"] is DBNull ? "" : drApply["sPerslCreditOwner"].ToString(); apply.PerslEmployment = drApply["sPerslEmployment"] is DBNull ? "" : drApply["sPerslEmployment"].ToString(); apply.PerslLoan = drApply["sPerslLoan"] is DBNull ? "" : drApply["sPerslLoan"].ToString(); apply.PerslLoanDue = drApply["sPerslLoanDue"] is DBNull ? "" : drApply["sPerslLoanDue"].ToString(); apply.PerslLoanSucc = drApply["sPerslLoanSucc"] is DBNull ? "" : drApply["sPerslLoanSucc"].ToString(); apply.PerslSalaryType = drApply["sPerslSalaryType"] is DBNull ? "" : drApply["sPerslSalaryType"].ToString(); apply.PerslWorkingAge = drApply["sPerslWorkingAge"] is DBNull ? "" : drApply["sPerslWorkingAge"].ToString(); apply.PerslYoBirth = drApply["sPerslYoBirth"] is DBNull ? "" : drApply["sPerslYoBirth"].ToString(); apply.ProductCode = drApply["sProductCode"] is DBNull ? "" : drApply["sProductCode"].ToString(); apply.ProductType = drApply["sProductType"] is DBNull ? "" : drApply["sProductType"].ToString(); m.ApplyingRecordList.Add(apply); } #endregion return m; }