/// <summary> /// 保存(传入事务处理) /// </summary> /// <param name="p_Entity"></param> /// <param name="p_BE"></param> /// <param name="sqlTrans"></param> public void RSave(WeaveProcess p_Entity, BaseEntity[] p_BE, IDBTransAccess sqlTrans) { try { string sql = "DELETE FROM WO_WeaveProcessDts2 WHERE MainID=" + p_Entity.ID.ToString(); sql += " AND ID NOT IN" + string.Format("({0})", GetIDExist(p_BE)); sqlTrans.ExecuteNonQuery(sql);//删除原单据里应该删除的明细数据,即数据库里有但是UI里已经删除的数据 for (int i = 0; i < p_BE.Length; i++) { WeaveProcessDts2 entitydts = (WeaveProcessDts2)p_BE[i]; if (entitydts.ID != 0)//ID不为0说明数据库中已经存在 { this.RUpdate(entitydts, sqlTrans); } else { entitydts.MainID = p_Entity.ID; this.RAdd(entitydts, sqlTrans); } } } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 删除 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Delete(BaseEntity p_Entity) { try { WeaveProcess MasterEntity = (WeaveProcess)p_Entity; if (MasterEntity.ID == 0) { return(0); } //删除主表数据 string Sql = ""; Sql = "DELETE FROM WO_WeaveProcess WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(Sql); } else { AffectedRows = sqlTrans.ExecuteNonQuery(Sql); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E); } }
/// <summary> /// 修改 /// </summary> /// <param name="p_BE">要修改的实体</param> /// <param name="sqlTrans">事务类</param> public void RUpdate(BaseEntity p_BE, BaseEntity[] p_BE2, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); WeaveProcess entity = (WeaveProcess)p_BE; WeaveProcessCtl control = new WeaveProcessCtl(sqlTrans); control.Update(entity); WeaveProcessDtsRule rule = new WeaveProcessDtsRule(); rule.RSave(entity, p_BE2, sqlTrans); //string sql = "DELETE WO_PrintingProcessDts WHERE MainID="+SysString.ToDBString(entity.ID); //sqlTrans.ExecuteNonQuery(sql); //for (int i = 0; i < p_BE2.Length; i++) //{ // WeaveProcessDtsRule rule = new WeaveProcessDtsRule(); // WeaveProcessDts entityDts = (WeaveProcessDts)p_BE2[i]; // entityDts.MainID = entity.ID; // entityDts.Seq = i + 1; // rule.RAdd(entityDts, sqlTrans); //} //ItemBuyCapDtsRule capRule = new ItemBuyCapDtsRule(); //capRule.RSaveBuyCap(entity, sqlTrans);//保存资金计划明细 } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 新增(传入事务处理) /// </summary> /// <param name="p_BE">要新增的实体</param> /// <param name="sqlTrans">事务类</param> public void RAdd(BaseEntity p_BE, BaseEntity[] p_BE2, BaseEntity[] p_BE3, IDBTransAccess sqlTrans) { try { this.RAdd(p_BE, sqlTrans); WeaveProcess entity = (WeaveProcess)p_BE; for (int i = 0; i < p_BE2.Length; i++) { WeaveProcessDtsRule rule = new WeaveProcessDtsRule(); WeaveProcessDts entityDts = (WeaveProcessDts)p_BE2[i]; entityDts.MainID = entity.ID; entityDts.Seq = i + 1; rule.RAdd(entityDts, sqlTrans); } for (int i = 0; i < p_BE3.Length; i++) { WeaveProcessDts2Rule rule2 = new WeaveProcessDts2Rule(); WeaveProcessDts2 entityDts2 = (WeaveProcessDts2)p_BE3[i]; entityDts2.MainID = entity.ID; entityDts2.Seq = i + 1; rule2.RAdd(entityDts2, sqlTrans); } FormNoControlRule rulest = new FormNoControlRule(); rulest.RAddSort((int)FormNoControlEnum.白坯织造加工单号, sqlTrans); //this.RAddDts(p_BE, p_BE2, p_BE3, sqlTrans);//保存明细数据 } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 新增(传入事务处理) /// </summary> /// <param name="p_BE">要新增的实体</param> /// <param name="sqlTrans">事务类</param> public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); WeaveProcess entity = (WeaveProcess)p_BE; string sql = "SELECT FormNo FROM WO_WeaveProcess WHERE FormNo=" + SysString.ToDBString(entity.FormNo); DataTable dt = sqlTrans.Fill(sql); if (dt.Rows.Count > 0) { throw new BaseException("织造加工单号已存在,请重新生成"); } WeaveProcessCtl control = new WeaveProcessCtl(sqlTrans); entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WO_WeaveProcess, sqlTrans); control.AddNew(entity); } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 删除 /// </summary> /// <param name="p_BE">要删除的实体</param> /// <param name="sqlTrans">事务类</param> public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); WeaveProcess entity = (WeaveProcess)p_BE; WeaveProcessCtl control = new WeaveProcessCtl(sqlTrans); control.Delete(entity); } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 审核 /// </summary> /// <param name="p_FormID">单据ID</param> /// <param name="p_Type">0/1/2/3:弃审/审核</param> public void RSubmit(int p_FormID, int p_Type, IDBTransAccess sqlTrans) { try { int p_TempType = p_Type;//处理状态 string sql = string.Empty; WeaveProcess entity = new WeaveProcess(sqlTrans); entity.ID = p_FormID; entity.SelectByID(); if (entity.SubmitFlag == p_Type)//如果相同异常 { throw new Exception("单据状态重复设置,请关闭程序重新打开操作"); } sql = "UPDATE WO_WeaveProcess SET SubmitFlag=" + SysString.ToDBString(p_Type); //if (p_Type == (int)ConfirmFlag.审核通过 || p_Type == (int)ConfirmFlag.审核拒绝) //{ //sql += ",SubmitOPID=" + SysString.ToDBString(ParamConfig.LoginName) + ",SubmitTime=" + SysString.ToDBString(DateTime.Now); //} sql += " WHERE ID=" + p_FormID.ToString();//更新单据主表审核状态 sqlTrans.ExecuteNonQuery(sql); //if (p_Type == (int)YesOrNo.Yes) //{ // sql = "SELECT ItemCode,ColorNum,ColorName FROM WO_PrintingProcessDts WHERE MainID=" + p_FormID; // DataTable dtDts = sqlTrans.Fill(sql); // SaleOrderRule salerule = new SaleOrderRule(); // foreach (DataRow dr in dtDts.Rows) // { // salerule.RUpdateStep(entity.OrderFormNo, dr["ItemCode"].ToString(), dr["ColorNum"].ToString(),dr["ColorName"].ToString(), (int)EnumOrderStep.采购, p_Type, true, sqlTrans); // } //} } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 新增(传入事务处理) /// </summary> /// <param name="p_BE">要新增的实体</param> /// <param name="sqlTrans">事务类</param> public void RAdd(BaseEntity p_BE, BaseEntity[] p_BE2, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); WeaveProcess entity = (WeaveProcess)p_BE; string sql = "SELECT FormNo FROM WO_WeaveProcess WHERE FormNo=" + SysString.ToDBString(entity.FormNo); DataTable dt = sqlTrans.Fill(sql); if (dt.Rows.Count > 0) { throw new BaseException("印花加工单号已存在,请重新生成"); } WeaveProcessCtl control = new WeaveProcessCtl(sqlTrans); entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WO_WeaveProcess, sqlTrans); control.AddNew(entity); for (int i = 0; i < p_BE2.Length; i++) { WeaveProcessDtsRule rule = new WeaveProcessDtsRule(); WeaveProcessDts entityDts = (WeaveProcessDts)p_BE2[i]; entityDts.MainID = entity.ID; entityDts.Seq = i + 1; rule.RAdd(entityDts, sqlTrans); } FormNoControlRule rulest = new FormNoControlRule(); rulest.RAddSort((int)FormNoControlEnum.白坯织造加工单号, sqlTrans); //ItemBuyCapDtsRule capRule = new ItemBuyCapDtsRule(); //capRule.RSaveBuyCap(entity, sqlTrans);//保存资金计划明细 } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 新增 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int AddNew(BaseEntity p_Entity) { try { WeaveProcess MasterEntity = (WeaveProcess)p_Entity; if (MasterEntity.ID == 0) { return(0); } //新增主表数据 StringBuilder MasterField = new StringBuilder(); StringBuilder MasterValue = new StringBuilder(); MasterField.Append("INSERT INTO WO_WeaveProcess("); MasterValue.Append(" VALUES("); MasterField.Append("ID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ","); MasterField.Append("FormNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.FormNo) + ","); MasterField.Append("MakeOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MakeOPID) + ","); MasterField.Append("MakeOPName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MakeOPName) + ","); MasterField.Append("MakeDate" + ","); if (MasterEntity.MakeDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.MakeDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("CheckOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CheckOPID) + ","); MasterField.Append("CheckDate" + ","); if (MasterEntity.CheckDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.CheckDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SubmitFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SubmitFlag) + ","); MasterField.Append("DelFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DelFlag) + ","); MasterField.Append("FormDate" + ","); if (MasterEntity.FormDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.FormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("VendorID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.VendorID) + ","); MasterField.Append("CustomerCode" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CustomerCode) + ","); MasterField.Append("OrderTypeID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.OrderTypeID) + ","); MasterField.Append("OrderLevelID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.OrderLevelID) + ","); MasterField.Append("OrderDate" + ","); if (MasterEntity.OrderDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.OrderDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("ReqDate" + ","); if (MasterEntity.ReqDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.ReqDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("OrderFormNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.OrderFormNo) + ","); MasterField.Append("Remark" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ","); MasterField.Append("PayMethodID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.PayMethodID) + ","); MasterField.Append("ContractDesc" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ContractDesc) + ","); MasterField.Append("TotalQty" + ","); if (MasterEntity.TotalQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.TotalQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("TotalAmount" + ","); if (MasterEntity.TotalAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.TotalAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("OrderPreStepID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.OrderPreStepID) + ","); MasterField.Append("OrderStepID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.OrderStepID) + ","); MasterField.Append("PayMethodFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.PayMethodFlag) + ","); MasterField.Append("StatusFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.StatusFlag) + ","); MasterField.Append("StatusName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.StatusName) + ","); MasterField.Append("WLAmountType" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.WLAmountType) + ","); MasterField.Append("WLAmount" + ","); if (MasterEntity.WLAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.WLAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DyeFactory" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DyeFactory) + ","); MasterField.Append("CustomerReq" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CustomerReq) + ","); MasterField.Append("LossQty" + ","); if (MasterEntity.LossQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.LossQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SendAddress" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SendAddress) + ","); MasterField.Append("SaleOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SaleOPID) + ","); MasterField.Append("NLQty" + ","); if (MasterEntity.NLQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.NLQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("NLFormDate" + ","); if (MasterEntity.NLFormDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.NLFormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InQty" + ","); if (MasterEntity.InQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InFormDate" + ","); if (MasterEntity.InFormDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.InFormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("OutQty" + ","); if (MasterEntity.OutQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.OutQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("OutFormDate" + ")"); if (MasterEntity.OutFormDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.OutFormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ")"); } else { MasterValue.Append("null)"); } //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } else { AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E); } }
/// <summary> /// 修改 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Update(BaseEntity p_Entity) { try { WeaveProcess MasterEntity = (WeaveProcess)p_Entity; if (MasterEntity.ID == 0) { return(0); } //更新主表数据 StringBuilder UpdateBuilder = new StringBuilder(); UpdateBuilder.Append("UPDATE WO_WeaveProcess SET "); UpdateBuilder.Append(" ID=" + SysString.ToDBString(MasterEntity.ID) + ","); UpdateBuilder.Append(" FormNo=" + SysString.ToDBString(MasterEntity.FormNo) + ","); UpdateBuilder.Append(" MakeOPID=" + SysString.ToDBString(MasterEntity.MakeOPID) + ","); UpdateBuilder.Append(" MakeOPName=" + SysString.ToDBString(MasterEntity.MakeOPName) + ","); if (MasterEntity.MakeDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" MakeDate=" + SysString.ToDBString(MasterEntity.MakeDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" MakeDate=null,"); } UpdateBuilder.Append(" CheckOPID=" + SysString.ToDBString(MasterEntity.CheckOPID) + ","); if (MasterEntity.CheckDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" CheckDate=" + SysString.ToDBString(MasterEntity.CheckDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" CheckDate=null,"); } UpdateBuilder.Append(" SubmitFlag=" + SysString.ToDBString(MasterEntity.SubmitFlag) + ","); UpdateBuilder.Append(" DelFlag=" + SysString.ToDBString(MasterEntity.DelFlag) + ","); if (MasterEntity.FormDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" FormDate=" + SysString.ToDBString(MasterEntity.FormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" FormDate=null,"); } UpdateBuilder.Append(" VendorID=" + SysString.ToDBString(MasterEntity.VendorID) + ","); UpdateBuilder.Append(" CustomerCode=" + SysString.ToDBString(MasterEntity.CustomerCode) + ","); UpdateBuilder.Append(" OrderTypeID=" + SysString.ToDBString(MasterEntity.OrderTypeID) + ","); UpdateBuilder.Append(" OrderLevelID=" + SysString.ToDBString(MasterEntity.OrderLevelID) + ","); if (MasterEntity.OrderDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" OrderDate=" + SysString.ToDBString(MasterEntity.OrderDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" OrderDate=null,"); } if (MasterEntity.ReqDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" ReqDate=" + SysString.ToDBString(MasterEntity.ReqDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" ReqDate=null,"); } UpdateBuilder.Append(" OrderFormNo=" + SysString.ToDBString(MasterEntity.OrderFormNo) + ","); UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ","); UpdateBuilder.Append(" PayMethodID=" + SysString.ToDBString(MasterEntity.PayMethodID) + ","); UpdateBuilder.Append(" ContractDesc=" + SysString.ToDBString(MasterEntity.ContractDesc) + ","); if (MasterEntity.TotalQty != 0) { UpdateBuilder.Append(" TotalQty=" + SysString.ToDBString(MasterEntity.TotalQty) + ","); } else { UpdateBuilder.Append(" TotalQty=null,"); } if (MasterEntity.TotalAmount != 0) { UpdateBuilder.Append(" TotalAmount=" + SysString.ToDBString(MasterEntity.TotalAmount) + ","); } else { UpdateBuilder.Append(" TotalAmount=null,"); } UpdateBuilder.Append(" OrderPreStepID=" + SysString.ToDBString(MasterEntity.OrderPreStepID) + ","); UpdateBuilder.Append(" OrderStepID=" + SysString.ToDBString(MasterEntity.OrderStepID) + ","); UpdateBuilder.Append(" PayMethodFlag=" + SysString.ToDBString(MasterEntity.PayMethodFlag) + ","); UpdateBuilder.Append(" StatusFlag=" + SysString.ToDBString(MasterEntity.StatusFlag) + ","); UpdateBuilder.Append(" StatusName=" + SysString.ToDBString(MasterEntity.StatusName) + ","); UpdateBuilder.Append(" WLAmountType=" + SysString.ToDBString(MasterEntity.WLAmountType) + ","); if (MasterEntity.WLAmount != 0) { UpdateBuilder.Append(" WLAmount=" + SysString.ToDBString(MasterEntity.WLAmount) + ","); } else { UpdateBuilder.Append(" WLAmount=null,"); } UpdateBuilder.Append(" DyeFactory=" + SysString.ToDBString(MasterEntity.DyeFactory) + ","); UpdateBuilder.Append(" CustomerReq=" + SysString.ToDBString(MasterEntity.CustomerReq) + ","); if (MasterEntity.LossQty != 0) { UpdateBuilder.Append(" LossQty=" + SysString.ToDBString(MasterEntity.LossQty) + ","); } else { UpdateBuilder.Append(" LossQty=null,"); } UpdateBuilder.Append(" SendAddress=" + SysString.ToDBString(MasterEntity.SendAddress) + ","); UpdateBuilder.Append(" SaleOPID=" + SysString.ToDBString(MasterEntity.SaleOPID) + ","); if (MasterEntity.NLQty != 0) { UpdateBuilder.Append(" NLQty=" + SysString.ToDBString(MasterEntity.NLQty) + ","); } else { UpdateBuilder.Append(" NLQty=null,"); } if (MasterEntity.NLFormDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" NLFormDate=" + SysString.ToDBString(MasterEntity.NLFormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" NLFormDate=null,"); } if (MasterEntity.InQty != 0) { UpdateBuilder.Append(" InQty=" + SysString.ToDBString(MasterEntity.InQty) + ","); } else { UpdateBuilder.Append(" InQty=null,"); } if (MasterEntity.InFormDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" InFormDate=" + SysString.ToDBString(MasterEntity.InFormDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" InFormDate=null,"); } if (MasterEntity.OutQty != 0) { UpdateBuilder.Append(" OutQty=" + SysString.ToDBString(MasterEntity.OutQty) + ","); } else { UpdateBuilder.Append(" OutQty=null,"); } if (MasterEntity.OutFormDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" OutFormDate=" + SysString.ToDBString(MasterEntity.OutFormDate.ToString("yyyy-MM-dd HH:mm:ss"))); } else { UpdateBuilder.Append(" OutFormDate=null"); } UpdateBuilder.Append(" WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID)); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString()); } else { AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString()); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E); } }
/// <summary> /// 检查将要操作的数据是否符合业务规则 /// </summary> /// <param name="p_BE"></param> private void CheckCorrect(BaseEntity p_BE) { WeaveProcess entity = (WeaveProcess)p_BE; }