/// <summary> /// 审核记录添加 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool VerfiyProcessRecordsAdd(VerifyProcess_Records model) { int result = 0; result = AuditProcessRecordsInstance.Add(model); return(result > 0 ? true : false); }
/// <summary> /// 根据条件查找数据 /// </summary> /// <param name="strCondition"></param> /// <returns></returns> public List<VerifyProcess_Records> GetListBy(OperationTypeEnum.AuditTemplateEnum templateKey, string ProcessNode, OperationTypeEnum.AudtiRecordsDataTypeEnum type) { string filter = " AND VRecord_Key='" + templateKey.ToString() + "' AND VRecord_Code='" + ProcessNode + "' AND VRecord_Flag='" + type.ToString() + "'"; List<VerifyProcess_Records> list = instance.GetListByWhere(filter); VerifyProcess_Records model = new VerifyProcess_Records(); return list; }
/// <summary> /// 更新数据 /// </summary> /// <param name='model'>实体</param> /// <returns>bool</returns> public bool Update(VerifyProcess_Records model) { bool result = false; var e = new ModelExceptions(); int _rseult = instance.Update(model); if (_rseult > 0) { result = true; } return(result); }
/// <summary> /// /// </summary> /// <param name="ModuleCode">模块关键字</param> /// <param name="CurNodeCode">阶段编码</param> /// <param name="RecordCode">单据编码(对应表的逻辑主键编码)</param> /// <returns></returns> public string Audit(VerifyProcess_Records vpRecord) { string re = string.Empty; //添加审核记录 先置其Stat为1 如果该次审核生效则回置其Stat值 vpRecord.Stat = 2; if (AuditProcessRecordsInstance.Add(vpRecord) > 0) { re = aInstance.Audit(vpRecord.VRecord_Code); } return re; }
/// <summary> /// 获取实体数据 /// </summary> /// <param name='strCondition'>条件(AND Code='11')</param> /// <returns>model</returns> public VerifyProcess_Records GetModel(string strCondition) { List <VerifyProcess_Records> list = instance.GetListByWhere(strCondition); VerifyProcess_Records model = new VerifyProcess_Records(); if (list != null && list.Count > 0) { model = list[0]; } else { model = null; } return(model); }
/// <summary> /// 插入数据 /// </summary> /// <param name='model'>实体</param> /// <param name='model'>是否完成验证</param> /// <returns>bool</returns> public bool Insert(VerifyProcess_Records model, bool IsValid) { var e = new ModelExceptions(); bool result = false; if (e.IsValid && IsValid) { //完成了验证,开始更新数据库了 int _result = instance.Add(model); if (_result > 0) { result = true; } } return(result); }
/// <summary> /// 逻辑删除数据 /// </summary> /// <param name='model'>model</param> /// <returns>bool</returns> public bool Delete(string Condition) { bool result = false; List <VerifyProcess_Records> list = instance.GetListByWhere(Condition); if (list.Count > 0) { VerifyProcess_Records model = list[0]; model.Stat = 1; int _rseult = instance.Update(model); if (_rseult > 0) { result = true; } } return(result); }
/// <summary> /// 审核单据 /// </summary> /// <param name="VerfiyKey">模块名称</param> /// <param name="KeyCode">编码字段名称</param> /// <param name="RecordId">编码单据号</param> /// <param name="AuditSuggest">备注</param> /// <param name="UserId">用户ID</param> /// <param name="NextAuditNode">下一审核节点</param> /// <param name="IsLastAuditNode">是否为最后一个节点</param> /// <returns></returns> public bool Audit(string VerfiyKey, string RecordId, string AuditSuggest, string UserId, string Agree, string VerfiyNodeCode, out string _ProResult ) { bool result = false; string ProResult = ""; _ProResult = ""; //审核单据,判断是否终审 VerifyProcess_Records Records = new VerifyProcess_Records() { Module_Code = VerfiyKey.ToString(), //模块编码 VRecord_Code = Bll_Comm.GetTableKey("VerifyProcess_Records"), Record_ID = RecordId, //单据ID VRecord_Opinion = AuditSuggest, //审理意见 VRecord_VCode = VerfiyNodeCode, //审核阶段编码 VRecord_Flag = Agree, VRecord_Owner = UserId, Stat = 2 }; int Temp_result = AuditProcessRecordsInstance.Add(Records); if (Temp_result > 0) { SqlParameter x1 = new SqlParameter("@auditCode", SqlDbType.VarChar, 50); x1.Value = Records.VRecord_Code; SqlParameter[] param = new SqlParameter[] { x1 }; IDbDataParameter[] parames = param as IDbDataParameter[]; DataTable dt = AuditProcessRecordsInstance.idb.RunProcReturnDatatable("qx_sp_audit", parames); ProResult = dt.Rows[0][0].ToString(); if (!string.IsNullOrEmpty(ProResult)) { result = true; _ProResult = ProResult; } } return(result); }
/// <summary> /// 插入数据 /// </summary> /// <param name='model'>实体</param> /// <returns>bool</returns> public bool Insert(VerifyProcess_Records model) { bool result = false; try { int _result = instance.Add(model); if (_result > 0) { result = true; } } catch (Exception ex) { throw ex; } return(result); }
/// <summary> /// 更新审核流程记录表 VerifyProcess_Records对象(即:一条记录 /// </summary> public int Update(VerifyProcess_Records verifyProcess_Records) { StringBuilder sbParameter = new StringBuilder(); StringBuilder sb = new StringBuilder(); sb.Append(@"UPDATE VerifyProcess_Records SET "); if (verifyProcess_Records.VRecord_Code_IsChanged) { sbParameter.Append("VRecord_Code=@VRecord_Code, "); } if (verifyProcess_Records.Module_Code_IsChanged) { sbParameter.Append("Module_Code=@Module_Code, "); } if (verifyProcess_Records.Record_ID_IsChanged) { sbParameter.Append("Record_ID=@Record_ID, "); } if (verifyProcess_Records.VRecord_VCode_IsChanged) { sbParameter.Append("VRecord_VCode=@VRecord_VCode, "); } if (verifyProcess_Records.VRecord_Owner_IsChanged) { sbParameter.Append("VRecord_Owner=@VRecord_Owner, "); } if (verifyProcess_Records.VRecord_Date_IsChanged) { sbParameter.Append("VRecord_Date=@VRecord_Date, "); } if (verifyProcess_Records.VRecord_Opinion_IsChanged) { sbParameter.Append("VRecord_Opinion=@VRecord_Opinion, "); } if (verifyProcess_Records.VRecord_Flag_IsChanged) { sbParameter.Append("VRecord_Flag=@VRecord_Flag, "); } if (verifyProcess_Records.VRecord_UDef1_IsChanged) { sbParameter.Append("VRecord_UDef1=@VRecord_UDef1, "); } if (verifyProcess_Records.VRecord_UDef2_IsChanged) { sbParameter.Append("VRecord_UDef2=@VRecord_UDef2, "); } if (verifyProcess_Records.VRecord_UDef3_IsChanged) { sbParameter.Append("VRecord_UDef3=@VRecord_UDef3, "); } if (verifyProcess_Records.VRecord_UDef4_IsChanged) { sbParameter.Append("VRecord_UDef4=@VRecord_UDef4, "); } if (verifyProcess_Records.VRecord_UDef5_IsChanged) { sbParameter.Append("VRecord_UDef5=@VRecord_UDef5, "); } if (verifyProcess_Records.VRecord_UDef6_IsChanged) { sbParameter.Append("VRecord_UDef6=@VRecord_UDef6, "); } if (verifyProcess_Records.Stat_IsChanged) { sbParameter.Append("Stat=@Stat "); } sb.Append(sbParameter.ToString().Trim().TrimEnd(',')); sb.Append(" WHERE 1=1 AND ((Stat is null) or (Stat=0)) and VRecord_ID=@VRecord_ID; "); string sql = sb.ToString(); if (verifyProcess_Records.VRecord_Code_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Code)) { idb.AddParameter("@VRecord_Code", DBNull.Value); } else { idb.AddParameter("@VRecord_Code", verifyProcess_Records.VRecord_Code); } } if (verifyProcess_Records.Module_Code_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.Module_Code)) { idb.AddParameter("@Module_Code", DBNull.Value); } else { idb.AddParameter("@Module_Code", verifyProcess_Records.Module_Code); } } if (verifyProcess_Records.Record_ID_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.Record_ID)) { idb.AddParameter("@Record_ID", DBNull.Value); } else { idb.AddParameter("@Record_ID", verifyProcess_Records.Record_ID); } } if (verifyProcess_Records.VRecord_VCode_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_VCode)) { idb.AddParameter("@VRecord_VCode", DBNull.Value); } else { idb.AddParameter("@VRecord_VCode", verifyProcess_Records.VRecord_VCode); } } if (verifyProcess_Records.VRecord_Owner_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Owner)) { idb.AddParameter("@VRecord_Owner", DBNull.Value); } else { idb.AddParameter("@VRecord_Owner", verifyProcess_Records.VRecord_Owner); } } if (verifyProcess_Records.VRecord_Date_IsChanged) { if (verifyProcess_Records.VRecord_Date == DateTime.MinValue) { idb.AddParameter("@VRecord_Date", DBNull.Value); } else { idb.AddParameter("@VRecord_Date", verifyProcess_Records.VRecord_Date); } } if (verifyProcess_Records.VRecord_Opinion_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Opinion)) { idb.AddParameter("@VRecord_Opinion", DBNull.Value); } else { idb.AddParameter("@VRecord_Opinion", verifyProcess_Records.VRecord_Opinion); } } if (verifyProcess_Records.VRecord_Flag_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Flag)) { idb.AddParameter("@VRecord_Flag", DBNull.Value); } else { idb.AddParameter("@VRecord_Flag", verifyProcess_Records.VRecord_Flag); } } if (verifyProcess_Records.VRecord_UDef1_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef1)) { idb.AddParameter("@VRecord_UDef1", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef1", verifyProcess_Records.VRecord_UDef1); } } if (verifyProcess_Records.VRecord_UDef2_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef2)) { idb.AddParameter("@VRecord_UDef2", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef2", verifyProcess_Records.VRecord_UDef2); } } if (verifyProcess_Records.VRecord_UDef3_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef3)) { idb.AddParameter("@VRecord_UDef3", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef3", verifyProcess_Records.VRecord_UDef3); } } if (verifyProcess_Records.VRecord_UDef4_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef4)) { idb.AddParameter("@VRecord_UDef4", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef4", verifyProcess_Records.VRecord_UDef4); } } if (verifyProcess_Records.VRecord_UDef5_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef5)) { idb.AddParameter("@VRecord_UDef5", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef5", verifyProcess_Records.VRecord_UDef5); } } if (verifyProcess_Records.VRecord_UDef6_IsChanged) { if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef6)) { idb.AddParameter("@VRecord_UDef6", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef6", verifyProcess_Records.VRecord_UDef6); } } if (verifyProcess_Records.Stat_IsChanged) { if (verifyProcess_Records.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", verifyProcess_Records.Stat); } } idb.AddParameter("@VRecord_ID", verifyProcess_Records.VRecord_ID); int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 添加审核流程记录表 VerifyProcess_Records对象(即:一条记录) /// </summary> public int Add(VerifyProcess_Records verifyProcess_Records) { string sql = "INSERT INTO VerifyProcess_Records (VRecord_Code,Module_Code,Record_ID,VRecord_VCode,VRecord_Owner,VRecord_Date,VRecord_Opinion,VRecord_Flag,VRecord_UDef1,VRecord_UDef2,VRecord_UDef3,VRecord_UDef4,VRecord_UDef5,VRecord_UDef6,Stat) VALUES (@VRecord_Code,@Module_Code,@Record_ID,@VRecord_VCode,@VRecord_Owner,@VRecord_Date,@VRecord_Opinion,@VRecord_Flag,@VRecord_UDef1,@VRecord_UDef2,@VRecord_UDef3,@VRecord_UDef4,@VRecord_UDef5,@VRecord_UDef6,@Stat)"; if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Code)) { idb.AddParameter("@VRecord_Code", DBNull.Value); } else { idb.AddParameter("@VRecord_Code", verifyProcess_Records.VRecord_Code); } if (string.IsNullOrEmpty(verifyProcess_Records.Module_Code)) { idb.AddParameter("@Module_Code", DBNull.Value); } else { idb.AddParameter("@Module_Code", verifyProcess_Records.Module_Code); } if (string.IsNullOrEmpty(verifyProcess_Records.Record_ID)) { idb.AddParameter("@Record_ID", DBNull.Value); } else { idb.AddParameter("@Record_ID", verifyProcess_Records.Record_ID); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_VCode)) { idb.AddParameter("@VRecord_VCode", DBNull.Value); } else { idb.AddParameter("@VRecord_VCode", verifyProcess_Records.VRecord_VCode); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Owner)) { idb.AddParameter("@VRecord_Owner", DBNull.Value); } else { idb.AddParameter("@VRecord_Owner", verifyProcess_Records.VRecord_Owner); } if (verifyProcess_Records.VRecord_Date == DateTime.MinValue) { idb.AddParameter("@VRecord_Date", DBNull.Value); } else { idb.AddParameter("@VRecord_Date", verifyProcess_Records.VRecord_Date); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Opinion)) { idb.AddParameter("@VRecord_Opinion", DBNull.Value); } else { idb.AddParameter("@VRecord_Opinion", verifyProcess_Records.VRecord_Opinion); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_Flag)) { idb.AddParameter("@VRecord_Flag", DBNull.Value); } else { idb.AddParameter("@VRecord_Flag", verifyProcess_Records.VRecord_Flag); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef1)) { idb.AddParameter("@VRecord_UDef1", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef1", verifyProcess_Records.VRecord_UDef1); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef2)) { idb.AddParameter("@VRecord_UDef2", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef2", verifyProcess_Records.VRecord_UDef2); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef3)) { idb.AddParameter("@VRecord_UDef3", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef3", verifyProcess_Records.VRecord_UDef3); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef4)) { idb.AddParameter("@VRecord_UDef4", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef4", verifyProcess_Records.VRecord_UDef4); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef5)) { idb.AddParameter("@VRecord_UDef5", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef5", verifyProcess_Records.VRecord_UDef5); } if (string.IsNullOrEmpty(verifyProcess_Records.VRecord_UDef6)) { idb.AddParameter("@VRecord_UDef6", DBNull.Value); } else { idb.AddParameter("@VRecord_UDef6", verifyProcess_Records.VRecord_UDef6); } if (verifyProcess_Records.Stat == 0) { idb.AddParameter("@Stat", 0); } else { idb.AddParameter("@Stat", verifyProcess_Records.Stat); } int Re = 0; //SQL日志记录 var RunMethod = System.Reflection.MethodBase.GetCurrentMethod(); System.Collections.Hashtable param = new System.Collections.Hashtable(); string Ex = "0"; foreach (System.Collections.DictionaryEntry item in idb.GetParameters()) { param.Add(item.Key, item.Value); } try { Re = idb.ExeCmd(sql); Ex = Re.ToString(); } catch (Exception ex) { Ex = ex.Message; } SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType + "." + RunMethod.Name, Ex); return(Re); }
/// <summary> /// 更新数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(VerifyProcess_Records model) { bool result = false; int _rseult = instance.Update(model); if (_rseult > 0) { result = true; } return result; }
public void InsertNextAuditRecord(string module, string node, string record) { try { VerifyProcess_Records r = new VerifyProcess_Records(); r.Module_Code = module; r.Record_ID = record; r.VRecord_VCode = node; r.Stat = 2; AuditProcessRecordsInstance.Add(r); } catch { } }
private string Accept() { VerifyProcess_Records record = new VerifyProcess_Records(); bmHelper.BindControlToModel<VerifyProcess_Records>(record, this.pnlMain.Controls, ""); record.VRecord_Owner = SessionConfig.UserCode; //record.VRecord_Opinion = ""; record.VRecord_Date = DateTime.Now; record.VRecord_Flag = QX.Common.C_Class.OperationTypeEnum.AudtiRecordsDataTypeEnum.Audited.ToString(); record.VRecord_VCode = CurNode;//当前阶段编码 record.Module_Code = ModuleCode;//审核模板关键字 record.Record_ID = DataCode;//单据编码 record.VRecord_Code = adInstance.GenerateVRecordCode();//记录编码 //处理方法 HandleMethod = record.VRecord_UDef2; string re= adInstance.Audit(record); var temp = MapSource.FirstOrDefault(o => o.Map_Source =="Normal"); //如果处于委员会 if (record.VRecord_VCode ==temp.Map_Object1) { IsToBackOrTrash(record); } else if(record.VRecord_VCode ==MapSource.FirstOrDefault(o => o.Map_Source=="FTrash").Map_Object1) { Failure_Information fInfo = fiInstance.GetModel(string.Format(" And FInfo_Code='{0}'", record.Record_ID)); fInfo.AuditStat = "LastAudit"; fInfo.AuditCurAudit = MapSource.FirstOrDefault(o => o.Map_Source == "FTrash").Map_Object1; fiInstance.UpdateFailure(fInfo); } else if (record.VRecord_VCode == MapSource.FirstOrDefault(o => o.Map_Source == "Back").Map_Object1) { Failure_Information fInfo = fiInstance.GetModel(string.Format(" And FInfo_Code='{0}'", record.Record_ID)); fInfo.AuditStat = "LastAudit"; fInfo.AuditCurAudit = MapSource.FirstOrDefault(o => o.Map_Source == "Back").Map_Object1; fiInstance.UpdateFailure(fInfo); } return re; }
/// <summary> /// 获取所有的审核流程记录表 VerifyProcess_Records对象(即:一条记录 /// </summary> public List <VerifyProcess_Records> GetAll() { List <VerifyProcess_Records> ret = new List <VerifyProcess_Records>(); string sql = "SELECT VRecord_ID,VRecord_Code,Module_Code,Record_ID,VRecord_VCode,VRecord_Owner,VRecord_Date,VRecord_Opinion,VRecord_Flag,VRecord_UDef1,VRecord_UDef2,VRecord_UDef3,VRecord_UDef4,VRecord_UDef5,VRecord_UDef6,Stat FROM VerifyProcess_Records where 1=1 AND ((Stat is null) or (Stat=0) ) order by VRecord_ID desc "; SqlDataReader dr = null; try { dr = (SqlDataReader)idb.ReturnReader(sql); while (dr.Read()) { VerifyProcess_Records verifyProcess_Records = new VerifyProcess_Records(); if (dr["VRecord_ID"] != DBNull.Value) { verifyProcess_Records.VRecord_ID = Convert.ToDecimal(dr["VRecord_ID"]); } if (dr["VRecord_Code"] != DBNull.Value) { verifyProcess_Records.VRecord_Code = Convert.ToString(dr["VRecord_Code"]); } if (dr["Module_Code"] != DBNull.Value) { verifyProcess_Records.Module_Code = Convert.ToString(dr["Module_Code"]); } if (dr["Record_ID"] != DBNull.Value) { verifyProcess_Records.Record_ID = Convert.ToString(dr["Record_ID"]); } if (dr["VRecord_VCode"] != DBNull.Value) { verifyProcess_Records.VRecord_VCode = Convert.ToString(dr["VRecord_VCode"]); } if (dr["VRecord_Owner"] != DBNull.Value) { verifyProcess_Records.VRecord_Owner = Convert.ToString(dr["VRecord_Owner"]); } if (dr["VRecord_Date"] != DBNull.Value) { verifyProcess_Records.VRecord_Date = Convert.ToDateTime(dr["VRecord_Date"]); } if (dr["VRecord_Opinion"] != DBNull.Value) { verifyProcess_Records.VRecord_Opinion = Convert.ToString(dr["VRecord_Opinion"]); } if (dr["VRecord_Flag"] != DBNull.Value) { verifyProcess_Records.VRecord_Flag = Convert.ToString(dr["VRecord_Flag"]); } if (dr["VRecord_UDef1"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef1 = Convert.ToString(dr["VRecord_UDef1"]); } if (dr["VRecord_UDef2"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef2 = Convert.ToString(dr["VRecord_UDef2"]); } if (dr["VRecord_UDef3"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef3 = Convert.ToString(dr["VRecord_UDef3"]); } if (dr["VRecord_UDef4"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef4 = Convert.ToString(dr["VRecord_UDef4"]); } if (dr["VRecord_UDef5"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef5 = Convert.ToString(dr["VRecord_UDef5"]); } if (dr["VRecord_UDef6"] != DBNull.Value) { verifyProcess_Records.VRecord_UDef6 = Convert.ToString(dr["VRecord_UDef6"]); } if (dr["Stat"] != DBNull.Value) { verifyProcess_Records.Stat = Convert.ToInt32(dr["Stat"]); } ret.Add(verifyProcess_Records); } }catch (System.Exception ex) { throw ex; } finally { if (dr != null) { dr.Close(); } if (idb.GetConnection() != null && idb.GetConnection().State == ConnectionState.Open) { idb.GetConnection().Close(); } } return(ret); }
/// <summary> /// 返工返修OR报废判断 /// </summary> /// <param name="record"></param> public void IsToBackOrTrash(VerifyProcess_Records record) { if (record.VRecord_UDef2 == "Back") { Failure_Information fInfo = fiInstance.GetModel(string.Format(" And FInfo_Code='{0}'", record.Record_ID)); fInfo.AuditStat = "OnAudit"; fInfo.AuditCurAudit = MapSource.FirstOrDefault(o => o.Map_Source == "Back").Map_Object1 ; fiInstance.UpdateFailure(fInfo); VerifyProcess_Records record1 = new VerifyProcess_Records(); record1.Module_Code = OperationTypeEnum.AuditTemplateEnum.FailureAudit_F001.ToString(); record1.Record_ID = fInfo.FInfo_Code; record1.VRecord_VCode = fInfo.AuditCurAudit; record1.Stat = 2; vrInstance.Insert(record1); } else if (record.VRecord_UDef2 == "FTrash") { Failure_Information fInfo = fiInstance.GetModel(string.Format(" And FInfo_Code='{0}'", record.Record_ID)); fInfo.FInfo_Stat = "FTrash"; fInfo.AuditStat = "OnAudit"; fInfo.AuditCurAudit = MapSource.FirstOrDefault(o => o.Map_Source =="FTrash").Map_Object1; fiInstance.UpdateFailure(fInfo); VerifyProcess_Records record1 = new VerifyProcess_Records(); record1.Module_Code = OperationTypeEnum.AuditTemplateEnum.FailureAudit_F001.ToString(); record1.Record_ID = fInfo.FInfo_Code; record1.VRecord_VCode = fInfo.AuditCurAudit; record1.Stat = 2; vrInstance.Insert(record1); } }
/// <summary> /// 根据条件查找数据 /// </summary> /// <param name="strCondition"></param> /// <returns></returns> public List<VerifyProcess_Records> GetListBy(string strCondition) { List<VerifyProcess_Records> list = instance.GetListByWhere(strCondition); VerifyProcess_Records model = new VerifyProcess_Records(); return list; }
private string Reject() { VerifyProcess_Records record = new VerifyProcess_Records(); bmHelper.BindControlToModel<VerifyProcess_Records>(record, this.pnlMain.Controls, ""); record.VRecord_Owner = SessionConfig.UserCode; //record.VRecord_Opinion = ""; record.VRecord_Date = DateTime.Now; record.VRecord_Flag = QX.Common.C_Class.OperationTypeEnum.AudtiRecordsDataTypeEnum.Reject.ToString(); record.VRecord_VCode = CurNode;//当前阶段编码 record.Module_Code = ModuleCode;//审核模板关键字 record.Record_ID = DataCode;//单据编码 record.VRecord_Code = adInstance.GenerateVRecordCode();//记录编码 return adInstance.Audit(record); }
/// <summary> /// 获取实体数据 /// </summary> /// <param name="strCondition"></param> /// <returns></returns> public VerifyProcess_Records GetModel(string strCondition) { List<VerifyProcess_Records> list = instance.GetListByWhere(strCondition); VerifyProcess_Records model = new VerifyProcess_Records(); if (list != null && list.Count > 0) { model = list[0]; } return model; }
/// <summary> /// 插入数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Insert(VerifyProcess_Records model) { bool result = false; int _result = instance.Add(model); if (_result > 0) { result = true; } return result; }
/// <summary> /// 获取实体数据 /// </summary> /// <param name='strCondition'>条件(AND Code='11')</param> /// <returns>model</returns> public VerifyProcess_Records GetModel(int id) { VerifyProcess_Records model = instance.GetByKey(id); return(model); }