/// <summary> /// 删除数据 /// </summary> /// <returns></returns> private string DeleteData() { try { string[] strs = Get("ids").Split(','); for (int i = 0; i < strs.Length; i++) { if (strs[i].Length == 0) { continue; } var model = new Insur_project_apply(); model.OID = strs[i].ToString(); ds.RetrieveObject(model); model.INSUR_NUMBER = ""; model.INSUR_COMPANY = ""; model.INSUR_HANLDMAN = ""; model.INSUR_HANLDMAN_PHONE = ""; ds.UpdateObject(model); } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "保险申请删除,出错:" + ex.ToString()); return("删除失败!"); } }
/// <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 (!InsurHandleClass.getInstance().IsCanCheck(row["OID"].ToString(), user.User_Role, out strMsg)) { nFailNum++; continue; } #endregion 筛选可以核对信息的数据 #region 更新核对信息 Insur_project_apply head = new Insur_project_apply(); head.OID = row["OID"].ToString(); ds.RetrieveObject(head); if (head == null) { continue; } Insur_apply_check check = InsurHandleClass.getInstance().GetApplyCheckInfo(head.SEQ_NO); check.OID = check.OID; ds.RetrieveObject(check); #region 由于医保新增了 参保人员字段,未填写以及 判断附件是否存在 //ZZ 20171214 新增校验:由于医保新增了 参保人员字段,未填写以及 判断附件是否存在 if (head.INSUR_TYPE.Equals("A"))//医保 { //判断 参保人员类别 字段是否填写 if (check.APPLY_TYPE.Length == 0)//医保时,参保人员类别 字段必填 { continue; } //判断 参保人员类别 != 普通在校生 时,校验是否上传了附件 if (!check.APPLY_TYPE.Equals("A")) { string strSQL = string.Format("SELECT COUNT(*) FROM INSUR_APPLY_CHECK_FILE WHERE SEQ_NO = '{0}' ", check.SEQ_NO); int nCount = cod.ChangeInt(ds.ExecuteTxtScalar(strSQL).ToString()); if (nCount <= 0) { continue; } } } #endregion 由于医保新增了 参保人员字段,未填写以及 判断附件是否存在 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_INSUR_LIMITDATE.ToString().Length > 0) { head.INSUR_LIMITDATE = check.NEW_INSUR_LIMITDATE; } #endregion 承保期限 #region 金额 //金额大于0 if (check.NEW_INSUR_MONEY.ToString().Length > 0 && cod.ChangeInt(check.NEW_INSUR_MONEY.ToString()) > 0) { head.INSUR_MONEY = check.NEW_INSUR_MONEY; } #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; //新增 Insur_apply_check head = new Insur_apply_check(); if (string.IsNullOrEmpty(Post("CHECK_OID"))) { head.OID = Guid.NewGuid().ToString(); ds.RetrieveObject(head); head.SEQ_NO = Post("hidApplySeqNo"); GetFormValue(head); //是否申请弃保 字段,如果没有值 就赋值 ,默认值 为否 if (string.IsNullOrWhiteSpace(Post("IS_REFUND"))) { head.IS_REFUND = CValue.FLAG_N; } var inserttrcn = ImplementFactory.GetInsertTransaction <Insur_apply_check>("Insur_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); //是否申请弃保 字段,如果没有值 就赋值 ,默认值 为否 if (string.IsNullOrWhiteSpace(Post("IS_REFUND"))) { head.IS_REFUND = CValue.FLAG_N; } var updatetrcn = ImplementFactory.GetUpdateTransaction <Insur_apply_check>("Insur_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); Insur_project_apply apply = InsurHandleClass.getInstance().GetInsurProjectApplyInfo(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")); } //银行卡号 if (!string.IsNullOrWhiteSpace(Post("STU_BANDKCODE"))) { StuHandleClass.getInstance().ByStuNumberUpStuInfo_BankCode(apply.STU_NUMBER, Post("STU_BANDKCODE")); } } #endregion 保存成功之后,修改的 手机号、身份证号、银行卡号 同步更新至学生个人信息中 StringBuilder json = new StringBuilder();//用来存放Json的 json.Append("{"); json.Append(Json.StringToJson(head.OID, "OID")); json.Append(","); json.Append(Json.StringToJson(head.SEQ_NO, "SEQ_NO")); json.Append("}"); return(json.ToString()); } else { return(string.Empty); } }