/// <summary> /// 删除 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Delete(BaseEntity p_Entity) { try { DBFormDts MasterEntity = (DBFormDts)p_Entity; if (MasterEntity.ID == 0) { return(0); } //删除主表数据 string Sql = ""; Sql = "DELETE FROM WH_DBFormDts 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> /// 获得数据库里没有被删除的ID(即数据库里有而且UI里也没有删除的数据) /// </summary> /// <param name="p_BE"></param> /// <returns></returns> private string GetIDExist(BaseEntity[] p_BE) { string outstr = "0"; for (int i = 0; i < p_BE.Length; i++) { DBFormDts entitydts = (DBFormDts)p_BE[i]; if (entitydts.ID != 0) { outstr += "," + entitydts.ID; } } return(outstr); }
/// <summary> /// 删除 /// </summary> /// <param name="p_BE">要删除的实体</param> /// <param name="sqlTrans">事务类</param> public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); DBFormDts entity = (DBFormDts)p_BE; DBFormDtsCtl control = new DBFormDtsCtl(sqlTrans); control.Delete(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 RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans) { try { this.CheckCorrect(p_BE); DBFormDts entity = (DBFormDts)p_BE; DBFormDtsCtl control = new DBFormDtsCtl(sqlTrans); entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WH_DBFormDts, 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 RAdd(BaseEntity p_BE, BaseEntity[] p_BE2, IDBTransAccess sqlTrans) { try { this.RAdd(p_BE, sqlTrans); DBForm entity = (DBForm)p_BE; DBFormDtsRule ruledts = new DBFormDtsRule(); for (int i = 0; i < p_BE2.Length; i++) { DBFormDts entityDts = (DBFormDts)p_BE2[i]; entityDts.MainID = entity.ID; entityDts.Seq = i + 1; ruledts.RAdd(entityDts, sqlTrans); } //ruledts.RSave((IOForm)p_BE, p_BE2, sqlTrans);//保存从表 //FormNoControlRule rulest = new FormNoControlRule(); //rulest.RAddSort((int)FormNoControlEnum.入库单号,sqlTrans); FormNoControlRule rulefn = new FormNoControlRule();//更新单号 int tempFormNoControlID = 0; string sql = "SELECT FormNoControlID FROM Enum_FormListDB WHERE ID=" + SysString.ToDBString(entity.FormListDBID); DataTable dt = sqlTrans.Fill(sql); if (dt.Rows.Count != 0) { tempFormNoControlID = SysConvert.ToInt32(dt.Rows[0]["FormNoControlID"].ToString()); } rulefn.RAddSort(tempFormNoControlID, sqlTrans); } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 保存(传入事务处理) /// </summary> /// <param name="p_Entity"></param> /// <param name="p_BE"></param> /// <param name="sqlTrans"></param> public void RSave(DBForm p_Entity, BaseEntity[] p_BE, IDBTransAccess sqlTrans) { try { string sql = string.Empty; sql = "";//删除码单明细表,代码待补充;如果是入库要删除原始码单表,需要仔细研究,因为某些情况下(先验布)原始码单还是需要保存的 sql = "DELETE FROM WH_DBFormDts 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++) { DBFormDts entitydts = (DBFormDts)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_BE"></param> private void CheckCorrect(BaseEntity p_BE) { DBFormDts entity = (DBFormDts)p_BE; }
/// <summary> /// 新增(传入事务处理) /// </summary> /// <param name="p_BE">要新增的实体</param> /// <param name="sqlTrans">事务类</param> public void RAdd(int p_ID, string p_IDStr, IDBTransAccess sqlTrans) { try { string sql = "SELECT SectionID,JarNum,Batch FROM WH_PackBox WHERE ID IN (" + p_IDStr + ")"; sql += " GROUP BY SectionID,JarNum,Batch"; DataTable dt = sqlTrans.Fill(sql); int MaxSeq = GetMaxSeq(p_ID); decimal Qty = 0; DBFormDtsRule rule = new DBFormDtsRule(); for (int i = 0; i < dt.Rows.Count; i++) { if (i == 0)//第一行更新 { sql = "SELECT * FROM WH_PackBox WHERE ID IN (" + p_IDStr + ")"; sql += " AND SectionID=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["SectionID"])); sql += " AND JarNum=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["JarNum"])); sql += " AND Batch=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["Batch"])); DataTable dtsql = sqlTrans.Fill(sql); DBFormDts entitydts = new DBFormDts(sqlTrans); entitydts.ID = p_ID; entitydts.SelectByID(); entitydts.SectionID = SysConvert.ToString(dt.Rows[i]["SectionID"]); entitydts.JarNum = SysConvert.ToString(dt.Rows[i]["JarNum"]); entitydts.Batch = SysConvert.ToString(dt.Rows[i]["Batch"]); entitydts.Qty = SysConvert.ToDecimal(dtsql.Compute("SUM(Qty)", "")); entitydts.PieceQty = dtsql.Rows.Count; entitydts.PackFlag = 1; entitydts.Amount = entitydts.Qty * entitydts.SinglePrice; rule.RUpdate(entitydts, sqlTrans); DBFormDtsPackRule prule = new DBFormDtsPackRule(); sql = "DELETE WH_DBFormDtsPack WHERE MainID=" + SysString.ToDBString(entitydts.MainID); sql += " AND Seq=" + SysString.ToDBString(entitydts.Seq); sqlTrans.ExecuteNonQuery(sql); for (int j = 0; j < dtsql.Rows.Count; j++) { DBFormDtsPack pentity = new DBFormDtsPack(sqlTrans); pentity.MainID = entitydts.MainID; pentity.Seq = entitydts.Seq; pentity.SubSeq = j + 1; pentity.BoxNo = SysConvert.ToString(dtsql.Rows[j]["BoxNo"]); pentity.Qty = SysConvert.ToDecimal(dtsql.Rows[j]["Qty"]); pentity.DID = entitydts.ID; prule.RAdd(pentity, sqlTrans); } } else { sql = "SELECT * FROM WH_PackBox WHERE ID IN (" + p_IDStr + ")"; sql += " AND SectionID=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["SectionID"])); sql += " AND JarNum=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["JarNum"])); sql += " AND Batch=" + SysString.ToDBString(SysConvert.ToString(dt.Rows[i]["Batch"])); DataTable dtsql = sqlTrans.Fill(sql); DBFormDts entitydts = new DBFormDts(sqlTrans); entitydts.ID = p_ID; entitydts.SelectByID(); entitydts.Seq = MaxSeq + i; entitydts.SectionID = SysConvert.ToString(dt.Rows[i]["SectionID"]); entitydts.JarNum = SysConvert.ToString(dt.Rows[i]["JarNum"]); entitydts.Batch = SysConvert.ToString(dt.Rows[i]["Batch"]); entitydts.Qty = SysConvert.ToDecimal(dtsql.Compute("SUM(Qty)", "")); entitydts.PieceQty = dtsql.Rows.Count; entitydts.PackFlag = 1; entitydts.Amount = entitydts.Qty * entitydts.SinglePrice; sql = "SELECT ID FROM WH_DBFormDts WHERE MainID=" + SysString.ToDBString(entitydts.MainID); sql += " AND Seq=" + SysString.ToDBString(entitydts.Seq); if (sqlTrans.Fill(sql).Rows.Count > 0) { throw new BaseException("不能增行,该行已存在"); } rule.RAdd(entitydts, sqlTrans); DBFormDtsPackRule prule = new DBFormDtsPackRule(); sql = "DELETE WH_DBFormDtsPack WHERE MainID=" + SysString.ToDBString(entitydts.MainID); sql += " AND Seq=" + SysString.ToDBString(entitydts.Seq); sqlTrans.ExecuteNonQuery(sql); for (int j = 0; j < dtsql.Rows.Count; j++) { DBFormDtsPack pentity = new DBFormDtsPack(sqlTrans); pentity.MainID = entitydts.MainID; pentity.Seq = entitydts.Seq; pentity.SubSeq = j + 1; pentity.BoxNo = SysConvert.ToString(dtsql.Rows[j]["BoxNo"]); pentity.Qty = SysConvert.ToDecimal(dtsql.Rows[j]["Qty"]); pentity.DID = entitydts.ID; prule.RAdd(pentity, sqlTrans); } } } } catch (BaseException) { throw; } catch (Exception E) { throw new BaseException(E.Message); } }
/// <summary> /// 修改 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Update(BaseEntity p_Entity) { try { DBFormDts MasterEntity = (DBFormDts)p_Entity; if (MasterEntity.ID == 0) { return(0); } //更新主表数据 StringBuilder UpdateBuilder = new StringBuilder(); UpdateBuilder.Append("UPDATE WH_DBFormDts SET "); UpdateBuilder.Append(" ID=" + SysString.ToDBString(MasterEntity.ID) + ","); UpdateBuilder.Append(" MainID=" + SysString.ToDBString(MasterEntity.MainID) + ","); UpdateBuilder.Append(" Seq=" + SysString.ToDBString(MasterEntity.Seq) + ","); UpdateBuilder.Append(" CompanyTypeID=" + SysString.ToDBString(MasterEntity.CompanyTypeID) + ","); UpdateBuilder.Append(" WHTypeID=" + SysString.ToDBString(MasterEntity.WHTypeID) + ","); UpdateBuilder.Append(" WHID=" + SysString.ToDBString(MasterEntity.WHID) + ","); UpdateBuilder.Append(" SectionID=" + SysString.ToDBString(MasterEntity.SectionID) + ","); UpdateBuilder.Append(" SBitID=" + SysString.ToDBString(MasterEntity.SBitID) + ","); UpdateBuilder.Append(" DtsVendorID=" + SysString.ToDBString(MasterEntity.DtsVendorID) + ","); UpdateBuilder.Append(" FromWHID=" + SysString.ToDBString(MasterEntity.FromWHID) + ","); UpdateBuilder.Append(" FromSectionID=" + SysString.ToDBString(MasterEntity.FromSectionID) + ","); UpdateBuilder.Append(" FromSBitID=" + SysString.ToDBString(MasterEntity.FromSBitID) + ","); UpdateBuilder.Append(" ItemCode=" + SysString.ToDBString(MasterEntity.ItemCode) + ","); UpdateBuilder.Append(" ItemName=" + SysString.ToDBString(MasterEntity.ItemName) + ","); UpdateBuilder.Append(" ItemStd=" + SysString.ToDBString(MasterEntity.ItemStd) + ","); UpdateBuilder.Append(" ItemModel=" + SysString.ToDBString(MasterEntity.ItemModel) + ","); UpdateBuilder.Append(" Batch=" + SysString.ToDBString(MasterEntity.Batch) + ","); UpdateBuilder.Append(" VendorBatch=" + SysString.ToDBString(MasterEntity.VendorBatch) + ","); UpdateBuilder.Append(" ColorNum=" + SysString.ToDBString(MasterEntity.ColorNum) + ","); UpdateBuilder.Append(" ColorName=" + SysString.ToDBString(MasterEntity.ColorName) + ","); UpdateBuilder.Append(" JarNum=" + SysString.ToDBString(MasterEntity.JarNum) + ","); UpdateBuilder.Append(" YarnStatus=" + SysString.ToDBString(MasterEntity.YarnStatus) + ","); UpdateBuilder.Append(" YarnTypeID=" + SysString.ToDBString(MasterEntity.YarnTypeID) + ","); UpdateBuilder.Append(" SizeName=" + SysString.ToDBString(MasterEntity.SizeName) + ","); UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ","); if (MasterEntity.Qty != 0) { UpdateBuilder.Append(" Qty=" + SysString.ToDBString(MasterEntity.Qty) + ","); } else { UpdateBuilder.Append(" Qty=null,"); } UpdateBuilder.Append(" Unit=" + SysString.ToDBString(MasterEntity.Unit) + ","); if (MasterEntity.Weight != 0) { UpdateBuilder.Append(" Weight=" + SysString.ToDBString(MasterEntity.Weight) + ","); } else { UpdateBuilder.Append(" Weight=null,"); } if (MasterEntity.SinglePrice != 0) { UpdateBuilder.Append(" SinglePrice=" + SysString.ToDBString(MasterEntity.SinglePrice) + ","); } else { UpdateBuilder.Append(" SinglePrice=null,"); } if (MasterEntity.Amount != 0) { UpdateBuilder.Append(" Amount=" + SysString.ToDBString(MasterEntity.Amount) + ","); } else { UpdateBuilder.Append(" Amount=null,"); } if (MasterEntity.WAmount != 0) { UpdateBuilder.Append(" WAmount=" + SysString.ToDBString(MasterEntity.WAmount) + ","); } else { UpdateBuilder.Append(" WAmount=null,"); } UpdateBuilder.Append(" DtsSO=" + SysString.ToDBString(MasterEntity.DtsSO) + ","); UpdateBuilder.Append(" DtsSaleOPID=" + SysString.ToDBString(MasterEntity.DtsSaleOPID) + ","); UpdateBuilder.Append(" Needle=" + SysString.ToDBString(MasterEntity.Needle) + ","); UpdateBuilder.Append(" YarnType=" + SysString.ToDBString(MasterEntity.YarnType) + ","); if (MasterEntity.SourceQty != 0) { UpdateBuilder.Append(" SourceQty=" + SysString.ToDBString(MasterEntity.SourceQty) + ","); } else { UpdateBuilder.Append(" SourceQty=null,"); } if (MasterEntity.MoveQty != 0) { UpdateBuilder.Append(" MoveQty=" + SysString.ToDBString(MasterEntity.MoveQty) + ","); } else { UpdateBuilder.Append(" MoveQty=null,"); } if (MasterEntity.SourceWeight != 0) { UpdateBuilder.Append(" SourceWeight=" + SysString.ToDBString(MasterEntity.SourceWeight) + ","); } else { UpdateBuilder.Append(" SourceWeight=null,"); } if (MasterEntity.MoveWeight != 0) { UpdateBuilder.Append(" MoveWeight=" + SysString.ToDBString(MasterEntity.MoveWeight) + ","); } else { UpdateBuilder.Append(" MoveWeight=null,"); } if (MasterEntity.TubeGW != 0) { UpdateBuilder.Append(" TubeGW=" + SysString.ToDBString(MasterEntity.TubeGW) + ","); } else { UpdateBuilder.Append(" TubeGW=null,"); } if (MasterEntity.SourceTubeQty != 0) { UpdateBuilder.Append(" SourceTubeQty=" + SysString.ToDBString(MasterEntity.SourceTubeQty) + ","); } else { UpdateBuilder.Append(" SourceTubeQty=null,"); } if (MasterEntity.MoveTubeQty != 0) { UpdateBuilder.Append(" MoveTubeQty=" + SysString.ToDBString(MasterEntity.MoveTubeQty) + ","); } else { UpdateBuilder.Append(" MoveTubeQty=null,"); } if (MasterEntity.TubeQty != 0) { UpdateBuilder.Append(" TubeQty=" + SysString.ToDBString(MasterEntity.TubeQty) + ","); } else { UpdateBuilder.Append(" TubeQty=null,"); } if (MasterEntity.SourcePieceQty != 0) { UpdateBuilder.Append(" SourcePieceQty=" + SysString.ToDBString(MasterEntity.SourcePieceQty) + ","); } else { UpdateBuilder.Append(" SourcePieceQty=null,"); } if (MasterEntity.MovePieceQty != 0) { UpdateBuilder.Append(" MovePieceQty=" + SysString.ToDBString(MasterEntity.MovePieceQty) + ","); } else { UpdateBuilder.Append(" MovePieceQty=null,"); } if (MasterEntity.PieceQty != 0) { UpdateBuilder.Append(" PieceQty=" + SysString.ToDBString(MasterEntity.PieceQty) + ","); } else { UpdateBuilder.Append(" PieceQty=null,"); } UpdateBuilder.Append(" PieceQtyDesc=" + SysString.ToDBString(MasterEntity.PieceQtyDesc) + ","); UpdateBuilder.Append(" JarNo=" + SysString.ToDBString(MasterEntity.JarNo) + ","); UpdateBuilder.Append(" Twist=" + SysString.ToDBString(MasterEntity.Twist) + ","); UpdateBuilder.Append(" DLCode=" + SysString.ToDBString(MasterEntity.DLCode) + ","); UpdateBuilder.Append(" GoodsCode=" + SysString.ToDBString(MasterEntity.GoodsCode) + ","); UpdateBuilder.Append(" GoodsLevel=" + SysString.ToDBString(MasterEntity.GoodsLevel) + ","); UpdateBuilder.Append(" VColorNum=" + SysString.ToDBString(MasterEntity.VColorNum) + ","); UpdateBuilder.Append(" VColorName=" + SysString.ToDBString(MasterEntity.VColorName) + ","); UpdateBuilder.Append(" VItemCode=" + SysString.ToDBString(MasterEntity.VItemCode) + ","); if (MasterEntity.PFPrice != 0) { UpdateBuilder.Append(" PFPrice=" + SysString.ToDBString(MasterEntity.PFPrice) + ","); } else { UpdateBuilder.Append(" PFPrice=null,"); } UpdateBuilder.Append(" ToWHID=" + SysString.ToDBString(MasterEntity.ToWHID) + ","); UpdateBuilder.Append(" ToSectionID=" + SysString.ToDBString(MasterEntity.ToSectionID) + ","); UpdateBuilder.Append(" ToSBitID=" + SysString.ToDBString(MasterEntity.ToSBitID) + ","); if (MasterEntity.MWidth != 0) { UpdateBuilder.Append(" MWidth=" + SysString.ToDBString(MasterEntity.MWidth) + ","); } else { UpdateBuilder.Append(" MWidth=null,"); } if (MasterEntity.MWeight != 0) { UpdateBuilder.Append(" MWeight=" + SysString.ToDBString(MasterEntity.MWeight) + ","); } else { UpdateBuilder.Append(" MWeight=null,"); } UpdateBuilder.Append(" WeightUnit=" + SysString.ToDBString(MasterEntity.WeightUnit) + ","); UpdateBuilder.Append(" DtsInVendorID=" + SysString.ToDBString(MasterEntity.DtsInVendorID) + ","); UpdateBuilder.Append(" InSO=" + SysString.ToDBString(MasterEntity.InSO) + ","); UpdateBuilder.Append(" InOrderFormNo=" + SysString.ToDBString(MasterEntity.InOrderFormNo) + ","); if (MasterEntity.InvoiceQty != 0) { UpdateBuilder.Append(" InvoiceQty=" + SysString.ToDBString(MasterEntity.InvoiceQty) + ","); } else { UpdateBuilder.Append(" InvoiceQty=null,"); } if (MasterEntity.InvoiceAmount != 0) { UpdateBuilder.Append(" InvoiceAmount=" + SysString.ToDBString(MasterEntity.InvoiceAmount) + ","); } else { UpdateBuilder.Append(" InvoiceAmount=null,"); } if (MasterEntity.PayAmount != 0) { UpdateBuilder.Append(" PayAmount=" + SysString.ToDBString(MasterEntity.PayAmount) + ","); } else { UpdateBuilder.Append(" PayAmount=null,"); } UpdateBuilder.Append(" DtsInvoiceDelFlag=" + SysString.ToDBString(MasterEntity.DtsInvoiceDelFlag) + ","); UpdateBuilder.Append(" DtsInvoiceDelOPID=" + SysString.ToDBString(MasterEntity.DtsInvoiceDelOPID) + ","); if (MasterEntity.DtsInvoiceDelTime != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" DtsInvoiceDelTime=" + SysString.ToDBString(MasterEntity.DtsInvoiceDelTime.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" DtsInvoiceDelTime=null,"); } UpdateBuilder.Append(" DtsInvoiceNo=" + SysString.ToDBString(MasterEntity.DtsInvoiceNo) + ","); if (MasterEntity.DZQty != 0) { UpdateBuilder.Append(" DZQty=" + SysString.ToDBString(MasterEntity.DZQty) + ","); } else { UpdateBuilder.Append(" DZQty=null,"); } if (MasterEntity.DZSinglePrice != 0) { UpdateBuilder.Append(" DZSinglePrice=" + SysString.ToDBString(MasterEntity.DZSinglePrice) + ","); } else { UpdateBuilder.Append(" DZSinglePrice=null,"); } if (MasterEntity.DZAmount != 0) { UpdateBuilder.Append(" DZAmount=" + SysString.ToDBString(MasterEntity.DZAmount) + ","); } else { UpdateBuilder.Append(" DZAmount=null,"); } UpdateBuilder.Append(" DZFlag=" + SysString.ToDBString(MasterEntity.DZFlag) + ","); UpdateBuilder.Append(" DZOPID=" + SysString.ToDBString(MasterEntity.DZOPID) + ","); if (MasterEntity.DZTime != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" DZTime=" + SysString.ToDBString(MasterEntity.DZTime.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" DZTime=null,"); } UpdateBuilder.Append(" DZNo=" + SysString.ToDBString(MasterEntity.DZNo) + ","); if (MasterEntity.FreeNum1 != 0) { UpdateBuilder.Append(" FreeNum1=" + SysString.ToDBString(MasterEntity.FreeNum1) + ","); } else { UpdateBuilder.Append(" FreeNum1=null,"); } UpdateBuilder.Append(" DtsOrderFormNo=" + SysString.ToDBString(MasterEntity.DtsOrderFormNo) + ","); UpdateBuilder.Append(" InSaleOPID=" + SysString.ToDBString(MasterEntity.InSaleOPID) + ","); if (MasterEntity.Tax != 0) { UpdateBuilder.Append(" Tax=" + SysString.ToDBString(MasterEntity.Tax) + ","); } else { UpdateBuilder.Append(" Tax=null,"); } if (MasterEntity.TaxAmount != 0) { UpdateBuilder.Append(" TaxAmount=" + SysString.ToDBString(MasterEntity.TaxAmount) + ","); } else { UpdateBuilder.Append(" TaxAmount=null,"); } UpdateBuilder.Append(" PackDts=" + SysString.ToDBString(MasterEntity.PackDts) + ","); UpdateBuilder.Append(" MLType=" + SysString.ToDBString(MasterEntity.MLType) + ","); if (MasterEntity.DYPrice != 0) { UpdateBuilder.Append(" DYPrice=" + SysString.ToDBString(MasterEntity.DYPrice) + ","); } else { UpdateBuilder.Append(" DYPrice=null,"); } if (MasterEntity.YQQty != 0) { UpdateBuilder.Append(" YQQty=" + SysString.ToDBString(MasterEntity.YQQty) + ","); } else { UpdateBuilder.Append(" YQQty=null,"); } if (MasterEntity.AQty != 0) { UpdateBuilder.Append(" AQty=" + SysString.ToDBString(MasterEntity.AQty) + ","); } else { UpdateBuilder.Append(" AQty=null,"); } if (MasterEntity.NOKPQty != 0) { UpdateBuilder.Append(" NOKPQty=" + SysString.ToDBString(MasterEntity.NOKPQty) + ","); } else { UpdateBuilder.Append(" NOKPQty=null,"); } if (MasterEntity.NoKPAmount != 0) { UpdateBuilder.Append(" NoKPAmount=" + SysString.ToDBString(MasterEntity.NoKPAmount) + ","); } else { UpdateBuilder.Append(" NoKPAmount=null,"); } UpdateBuilder.Append(" PackFlag=" + SysString.ToDBString(MasterEntity.PackFlag) + ","); UpdateBuilder.Append(" LoadDtsID=" + SysString.ToDBString(MasterEntity.LoadDtsID) + ","); if (MasterEntity.InputQty != 0) { UpdateBuilder.Append(" InputQty=" + SysString.ToDBString(MasterEntity.InputQty) + ","); } else { UpdateBuilder.Append(" InputQty=null,"); } UpdateBuilder.Append(" InputUnit=" + SysString.ToDBString(MasterEntity.InputUnit) + ","); if (MasterEntity.InputSinglePrice != 0) { UpdateBuilder.Append(" InputSinglePrice=" + SysString.ToDBString(MasterEntity.InputSinglePrice) + ","); } else { UpdateBuilder.Append(" InputSinglePrice=null,"); } if (MasterEntity.InputAmount != 0) { UpdateBuilder.Append(" InputAmount=" + SysString.ToDBString(MasterEntity.InputAmount) + ","); } else { UpdateBuilder.Append(" InputAmount=null,"); } if (MasterEntity.InputConvertXS != 0) { UpdateBuilder.Append(" InputConvertXS=" + SysString.ToDBString(MasterEntity.InputConvertXS)); } else { UpdateBuilder.Append(" InputConvertXS=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_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int AddNew(BaseEntity p_Entity) { try { DBFormDts MasterEntity = (DBFormDts)p_Entity; if (MasterEntity.ID == 0) { return(0); } //新增主表数据 StringBuilder MasterField = new StringBuilder(); StringBuilder MasterValue = new StringBuilder(); MasterField.Append("INSERT INTO WH_DBFormDts("); MasterValue.Append(" VALUES("); MasterField.Append("ID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ","); MasterField.Append("MainID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MainID) + ","); MasterField.Append("Seq" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Seq) + ","); MasterField.Append("CompanyTypeID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CompanyTypeID) + ","); MasterField.Append("WHTypeID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.WHTypeID) + ","); MasterField.Append("WHID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.WHID) + ","); MasterField.Append("SectionID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SectionID) + ","); MasterField.Append("SBitID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SBitID) + ","); MasterField.Append("DtsVendorID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsVendorID) + ","); MasterField.Append("FromWHID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.FromWHID) + ","); MasterField.Append("FromSectionID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.FromSectionID) + ","); MasterField.Append("FromSBitID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.FromSBitID) + ","); MasterField.Append("ItemCode" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ItemCode) + ","); MasterField.Append("ItemName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ItemName) + ","); MasterField.Append("ItemStd" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ItemStd) + ","); MasterField.Append("ItemModel" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ItemModel) + ","); MasterField.Append("Batch" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Batch) + ","); MasterField.Append("VendorBatch" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.VendorBatch) + ","); MasterField.Append("ColorNum" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ColorNum) + ","); MasterField.Append("ColorName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ColorName) + ","); MasterField.Append("JarNum" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.JarNum) + ","); MasterField.Append("YarnStatus" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.YarnStatus) + ","); MasterField.Append("YarnTypeID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.YarnTypeID) + ","); MasterField.Append("SizeName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SizeName) + ","); MasterField.Append("Remark" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ","); MasterField.Append("Qty" + ","); if (MasterEntity.Qty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.Qty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("Unit" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Unit) + ","); MasterField.Append("Weight" + ","); if (MasterEntity.Weight != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.Weight) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SinglePrice" + ","); if (MasterEntity.SinglePrice != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.SinglePrice) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("Amount" + ","); if (MasterEntity.Amount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.Amount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("WAmount" + ","); if (MasterEntity.WAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.WAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DtsSO" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsSO) + ","); MasterField.Append("DtsSaleOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsSaleOPID) + ","); MasterField.Append("Needle" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Needle) + ","); MasterField.Append("YarnType" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.YarnType) + ","); MasterField.Append("SourceQty" + ","); if (MasterEntity.SourceQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.SourceQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("MoveQty" + ","); if (MasterEntity.MoveQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MoveQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SourceWeight" + ","); if (MasterEntity.SourceWeight != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.SourceWeight) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("MoveWeight" + ","); if (MasterEntity.MoveWeight != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MoveWeight) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("TubeGW" + ","); if (MasterEntity.TubeGW != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.TubeGW) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SourceTubeQty" + ","); if (MasterEntity.SourceTubeQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.SourceTubeQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("MoveTubeQty" + ","); if (MasterEntity.MoveTubeQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MoveTubeQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("TubeQty" + ","); if (MasterEntity.TubeQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.TubeQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SourcePieceQty" + ","); if (MasterEntity.SourcePieceQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.SourcePieceQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("MovePieceQty" + ","); if (MasterEntity.MovePieceQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MovePieceQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("PieceQty" + ","); if (MasterEntity.PieceQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.PieceQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("PieceQtyDesc" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.PieceQtyDesc) + ","); MasterField.Append("JarNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.JarNo) + ","); MasterField.Append("Twist" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Twist) + ","); MasterField.Append("DLCode" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DLCode) + ","); MasterField.Append("GoodsCode" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.GoodsCode) + ","); MasterField.Append("GoodsLevel" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.GoodsLevel) + ","); MasterField.Append("VColorNum" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.VColorNum) + ","); MasterField.Append("VColorName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.VColorName) + ","); MasterField.Append("VItemCode" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.VItemCode) + ","); MasterField.Append("PFPrice" + ","); if (MasterEntity.PFPrice != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.PFPrice) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("ToWHID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ToWHID) + ","); MasterField.Append("ToSectionID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ToSectionID) + ","); MasterField.Append("ToSBitID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ToSBitID) + ","); MasterField.Append("MWidth" + ","); if (MasterEntity.MWidth != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MWidth) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("MWeight" + ","); if (MasterEntity.MWeight != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.MWeight) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("WeightUnit" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.WeightUnit) + ","); MasterField.Append("DtsInVendorID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsInVendorID) + ","); MasterField.Append("InSO" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.InSO) + ","); MasterField.Append("InOrderFormNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.InOrderFormNo) + ","); MasterField.Append("InvoiceQty" + ","); if (MasterEntity.InvoiceQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InvoiceQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InvoiceAmount" + ","); if (MasterEntity.InvoiceAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InvoiceAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("PayAmount" + ","); if (MasterEntity.PayAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.PayAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DtsInvoiceDelFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsInvoiceDelFlag) + ","); MasterField.Append("DtsInvoiceDelOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsInvoiceDelOPID) + ","); MasterField.Append("DtsInvoiceDelTime" + ","); if (MasterEntity.DtsInvoiceDelTime != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.DtsInvoiceDelTime.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DtsInvoiceNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsInvoiceNo) + ","); MasterField.Append("DZQty" + ","); if (MasterEntity.DZQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.DZQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DZSinglePrice" + ","); if (MasterEntity.DZSinglePrice != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.DZSinglePrice) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DZAmount" + ","); if (MasterEntity.DZAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.DZAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DZFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DZFlag) + ","); MasterField.Append("DZOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DZOPID) + ","); MasterField.Append("DZTime" + ","); if (MasterEntity.DZTime != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.DZTime.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DZNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DZNo) + ","); MasterField.Append("FreeNum1" + ","); if (MasterEntity.FreeNum1 != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.FreeNum1) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("DtsOrderFormNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DtsOrderFormNo) + ","); MasterField.Append("InSaleOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.InSaleOPID) + ","); MasterField.Append("Tax" + ","); if (MasterEntity.Tax != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.Tax) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("TaxAmount" + ","); if (MasterEntity.TaxAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.TaxAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("PackDts" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.PackDts) + ","); MasterField.Append("MLType" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MLType) + ","); MasterField.Append("DYPrice" + ","); if (MasterEntity.DYPrice != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.DYPrice) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("YQQty" + ","); if (MasterEntity.YQQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.YQQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("AQty" + ","); if (MasterEntity.AQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.AQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("NOKPQty" + ","); if (MasterEntity.NOKPQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.NOKPQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("NoKPAmount" + ","); if (MasterEntity.NoKPAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.NoKPAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("PackFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.PackFlag) + ","); MasterField.Append("LoadDtsID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.LoadDtsID) + ","); MasterField.Append("InputQty" + ","); if (MasterEntity.InputQty != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InputQty) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InputUnit" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.InputUnit) + ","); MasterField.Append("InputSinglePrice" + ","); if (MasterEntity.InputSinglePrice != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InputSinglePrice) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InputAmount" + ","); if (MasterEntity.InputAmount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InputAmount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("InputConvertXS" + ")"); if (MasterEntity.InputConvertXS != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.InputConvertXS) + ")"); } 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> /// <returns></returns> private DBFormDts[] EntityDtsGet() { int index = GetDataCompleteNum(); DBFormDts[] entitydts = new DBFormDts[index]; index = 0; for (int i = 0; i < gridView1.RowCount; i++) { if (CheckDataCompleteDts(i)) { entitydts[index] = new DBFormDts(); entitydts[index].ID = SysConvert.ToInt32(gridView1.GetRowCellValue(i, "ID")); entitydts[index].SelectByID(); entitydts[index].MainID = HTDataID; entitydts[index].Seq = i + 1; entitydts[index].WHID = SysConvert.ToString(drpWHID.EditValue); entitydts[index].SectionID = SysConvert.ToString(gridView1.GetRowCellValue(i, "SectionID")); entitydts[index].SBitID = SysConvert.ToString(gridView1.GetRowCellValue(i, "SBitID")); entitydts[index].ItemCode = SysConvert.ToString(gridView1.GetRowCellValue(i, "ItemCode")); entitydts[index].ItemName = SysConvert.ToString(gridView1.GetRowCellValue(i, "ItemName")); entitydts[index].ItemStd = SysConvert.ToString(gridView1.GetRowCellValue(i, "ItemStd")); entitydts[index].ItemModel = SysConvert.ToString(gridView1.GetRowCellValue(i, "ItemModel")); entitydts[index].Batch = SysConvert.ToString(gridView1.GetRowCellValue(i, "Batch")); entitydts[index].VendorBatch = SysConvert.ToString(gridView1.GetRowCellValue(i, "VendorBatch")); entitydts[index].ColorNum = SysConvert.ToString(gridView1.GetRowCellValue(i, "ColorNum")); entitydts[index].ColorName = SysConvert.ToString(gridView1.GetRowCellValue(i, "ColorName")); entitydts[index].JarNum = SysConvert.ToString(gridView1.GetRowCellValue(i, "JarNum")); entitydts[index].PieceQty = SysConvert.ToInt32(gridView1.GetRowCellValue(i, "PieceQty")); entitydts[index].Remark = SysConvert.ToString(gridView1.GetRowCellValue(i, "Remark")); entitydts[index].Qty = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "Qty")); entitydts[index].Unit = SysConvert.ToString(gridView1.GetRowCellValue(i, "Unit")); entitydts[index].Weight = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "Weight")); entitydts[index].SinglePrice = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "SinglePrice")); entitydts[index].DYPrice = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "DYPrice")); entitydts[index].InputQty = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "InputQty")); entitydts[index].InputUnit = SysConvert.ToString(gridView1.GetRowCellValue(i, "InputUnit")); entitydts[index].InputSinglePrice = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "InputSinglePrice")); entitydts[index].InputAmount = entitydts[index].InputSinglePrice * entitydts[index].InputQty + entitydts[index].DYPrice;// +entitydts[index].FAmount1 + entitydts[index].FAmount2 + entitydts[index].FAmount3 + entitydts[index].FAmount4 + entitydts[index].FAmount5; entitydts[index].InputConvertXS = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "InputConvertXS")); entitydts[index].Amount = entitydts[index].SinglePrice * entitydts[index].Qty + entitydts[index].DYPrice; entitydts[index].DLCode = SysConvert.ToString(gridView1.GetRowCellValue(i, "DLCode")); entitydts[index].GoodsCode = SysConvert.ToString(gridView1.GetRowCellValue(i, "GoodsCode")); entitydts[index].GoodsLevel = SysConvert.ToString(gridView1.GetRowCellValue(i, "GoodsLevel")); entitydts[index].VColorNum = SysConvert.ToString(gridView1.GetRowCellValue(i, "VColorNum")); entitydts[index].VColorName = SysConvert.ToString(gridView1.GetRowCellValue(i, "VColorName")); entitydts[index].VItemCode = SysConvert.ToString(gridView1.GetRowCellValue(i, "VItemCode")); entitydts[index].MWeight = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "MWeight")); entitydts[index].MWidth = SysConvert.ToDecimal(gridView1.GetRowCellValue(i, "MWidth")); entitydts[index].WeightUnit = SysConvert.ToString(gridView1.GetRowCellValue(i, "WeightUnit")); entitydts[index].PackDts = SysConvert.ToString(gridView1.GetRowCellValue(i, "PackDts")); entitydts[index].DtsSO = SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsSO")); entitydts[index].DtsVendorID = SysConvert.ToString(drpVendorID.EditValue); //SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsVendorID")); entitydts[index].DtsOrderFormNo = SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsOrderFormNo")); entitydts[index].DtsSaleOPID = SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsSaleOPID")); //SysConvert.ToString(drpSaleOPID.EditValue);//SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsSaleOPID")); entitydts[index].DtsInVendorID = SysConvert.ToString(gridView1.GetRowCellValue(i, "DtsInVendorID")); entitydts[index].InSO = SysConvert.ToString(gridView1.GetRowCellValue(i, "InSO")); entitydts[index].InOrderFormNo = SysConvert.ToString(gridView1.GetRowCellValue(i, "InOrderFormNo")); entitydts[index].InSaleOPID = SysConvert.ToString(gridView1.GetRowCellValue(i, "InSaleOPID")); entitydts[index].MLType = SysConvert.ToInt32(gridView1.GetRowCellValue(i, "MLType")); entitydts[index].LoadDtsID = SysConvert.ToInt32(gridView1.GetRowCellValue(i, "LoadDtsID")); //if ((SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5404)) && entitydts[index].InputUnit != string.Empty)//销售订单使用下单数量制单时确定是否需要单位转换模式及计算方法类型 默认否,此功能设置为是时,5405应设置为0 // || SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5405)))//转换为默认单位模式开启,目前支持转换为公斤模式 //{ // entitydts[index].InputQty = ProductCommon.UnitConvertValueAnyUnit(entitydts[index].Unit, entitydts[index].Qty, entitydts[index].InputUnit, entitydts[index].InputConvertXS); // entitydts[index].InputAmount = entitydts[index].InputSinglePrice * entitydts[index].InputQty + entitydts[index].DYPrice; // entitydts[index].SinglePrice = SysConvert.ToDecimal(entitydts[index].InputSinglePrice * entitydts[index].InputConvertXS, 2); // entitydts[index].Amount = entitydts[index].InputAmount; //} index++; } } return(entitydts); }