/// <summary> /// 批量确认核对信息 /// </summary> /// <returns></returns> private string MultiCheck() { try { DataTable dtMultiCheck = GetMultiCheckData(); if (dtMultiCheck == null) { return("批量核对失败:批量核对数据读取失败!"); } int nSuccessNum = 0; int nFailNum = 0; foreach (DataRow row in dtMultiCheck.Rows) { #region 筛选可以核对信息的数据 //筛选可以核对信息的数据 if (row == null) { continue; } string strMsg = string.Empty; if (!LoanHandleClass.getInstance().IsCanCheck(row["OID"].ToString(), user.User_Role, out strMsg)) { nFailNum++; continue; } #endregion 筛选可以核对信息的数据 #region 更新核对信息 Loan_project_apply head = new Loan_project_apply(); head.OID = row["OID"].ToString(); ds.RetrieveObject(head); if (head == null) { continue; } Loan_apply_check check = LoanHandleClass.getInstance().GetApplyCheckInfo(head.SEQ_NO); check.OID = check.OID; ds.RetrieveObject(check); switch (user.User_Role) { case "F": //辅导员 check.CHECK_STEP = "2"; //辅导员已核对 check.F_CHECK_CODE = user.User_Id; check.F_CHECK_NAME = user.User_Name; check.F_CHECK_TIME = GetDateLongFormater(); break; case "Y": //学院 check.CHECK_STEP = "3"; //学院已核对 check.Y_CHECK_CODE = user.User_Id; check.Y_CHECK_NAME = user.User_Name; check.Y_CHECK_TIME = GetDateLongFormater(); break; } ds.UpdateObject(check); nSuccessNum++; #endregion 更新核对信息 #region 步学生信息中的银行卡号,修改成核对后的数据 if (check.CHECK_STEP.Equals("3")) { #region 银行卡号 if (check.NEW_BANKCODE.ToString().Length > 0) { head.STU_BANKCODE = check.NEW_BANKCODE; //更新至学生银行卡信息中的银行卡号 string strSqlBank = string.Format("UPDATE BASIC_STU_BANK_INFO SET BANKCODE = '{0}' WHERE NUMBER = '{1}' ", head.STU_BANKCODE, head.STU_NUMBER); ds.ExecuteTxtNonQuery(strSqlBank); } #endregion 银行卡号 ds.UpdateObject(head); } #endregion 步学生信息中的银行卡号,修改成核对后的数据 } return(string.Format("批量核对成功:生效{0}条记录,不生效{1}条记录。", nSuccessNum, nFailNum)); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "贷款核对信息批量核对出错:" + ex.ToString()); return("批量核对失败!"); } }
/// <summary> /// 保存数据 /// </summary> /// <returns></returns> private string SaveData() { bool bFlag = false; //新增 Loan_apply_check head = new Loan_apply_check(); if (string.IsNullOrEmpty(Post("CHECK_OID"))) { head.OID = Guid.NewGuid().ToString(); ds.RetrieveObject(head); head.SEQ_NO = Post("hidApplySeqNo"); GetFormValue(head); var inserttrcn = ImplementFactory.GetInsertTransaction <Loan_apply_check>("Loan_apply_checkInsertTransaction", user.User_Name); inserttrcn.EntityList.Add(head); if (inserttrcn.Commit()) { bFlag = true; } } else //修改 { head.OID = Post("CHECK_OID"); ds.RetrieveObject(head); GetFormValue(head); var updatetrcn = ImplementFactory.GetUpdateTransaction <Loan_apply_check>("Loan_apply_checkUpdateTransaction", user.User_Name); if (updatetrcn.Commit(head)) { bFlag = true; } } if (bFlag) { #region 保存成功之后,修改的 手机号、银行卡号 同步更新至学生个人信息中 //ZZ 20171213 修改:保存成功之后,修改的 手机号、身份证号 同步更新至学生个人信息中 Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("SEQ_NO", head.SEQ_NO); Loan_project_apply apply = LoanHandleClass.getInstance().GetLoanProjectApplyInfo(param); if (apply != null) { //手机号 if (!string.IsNullOrWhiteSpace(Post("STU_PHONE"))) { StuHandleClass.getInstance().ByStuNumberUpStuInfo_Phone(apply.STU_NUMBER, Post("STU_PHONE")); } //身份证号 if (!string.IsNullOrWhiteSpace(Post("STU_IDNO"))) { StuHandleClass.getInstance().ByStuNumberUpStuInfo_IDNo(apply.STU_NUMBER, Post("STU_IDNO")); } } #endregion 保存成功之后,修改的 手机号、银行卡号 同步更新至学生个人信息中 return(string.Empty); } else { return("保存核对信息失败!"); } }