예제 #1
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            GoodsTransRule rule   = new GoodsTransRule();
            GoodsTrans     entity = EntityGet();

            rule.RDelete(entity);
        }
예제 #2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                GoodsTrans MasterEntity = (GoodsTrans)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM Att_GoodsTrans 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);
            }
        }
예제 #3
0
 /// <summary>
 /// 保存(传入事务处理)
 /// </summary>
 /// <param name="p_Entity"></param>
 /// <param name="p_BE"></param>
 /// <param name="sqlTrans"></param>
 public void RSave(GoodsTrans p_Entity, BaseEntity[] p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         string sql = "DELETE FROM Att_GoodsTransDts 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++)
         {
             GoodsTransDts entitydts = (GoodsTransDts)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);
     }
 }
예제 #4
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private GoodsTrans EntityGet()
        {
            GoodsTrans entity = new GoodsTrans();

            entity.ID = HTDataID;
            return(entity);
        }
예제 #5
0
 /// <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);
         GoodsTrans    entity  = (GoodsTrans)p_BE;
         GoodsTransCtl control = new GoodsTransCtl(sqlTrans);
         control.Update(entity);
         GoodsTransDtsRule rule = new GoodsTransDtsRule();
         rule.RSave(entity, p_BE2, sqlTrans);
         //string sql = "DELETE Att_GoodsTransDts WHERE MainID="+SysString.ToDBString(entity.ID);
         //sqlTrans.ExecuteNonQuery(sql);
         //for (int i = 0; i < p_BE2.Length; i++)
         //{
         //    GoodsTransDtsRule rule = new GoodsTransDtsRule();
         //    GoodsTransDts entityDts = (GoodsTransDts)p_BE2[i];
         //    entityDts.MainID = entity.ID;
         //    entityDts.Seq = i + 1;
         //    rule.RAdd(entityDts, sqlTrans);
         //}
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
예제 #6
0
 /// <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);
         GoodsTrans entity = (GoodsTrans)p_BE;
         string     sql    = "SELECT FormNo FROM Att_GoodsTrans WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable  dt     = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("物流单号已存在,请重新生成");
         }
         GoodsTransCtl control = new GoodsTransCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Att_GoodsTrans, sqlTrans);
         control.AddNew(entity);
         for (int i = 0; i < p_BE2.Length; i++)
         {
             GoodsTransDtsRule rule      = new GoodsTransDtsRule();
             GoodsTransDts     entityDts = (GoodsTransDts)p_BE2[i];
             entityDts.MainID = entity.ID;
             entityDts.Seq    = i + 1;
             rule.RAdd(entityDts, sqlTrans);
         }
         FormNoControlRule rulest = new FormNoControlRule();
         rulest.RAddSort((int)FormNoControlEnum.物流单号, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
예제 #7
0
        /// <summary>
        /// 设置
        /// </summary>
        public override void EntitySet()
        {
            GoodsTrans entity = new GoodsTrans();

            entity.ID = HTDataID;
            bool findFlag = entity.SelectByID();

            txtFormNo.Text          = entity.FormNo.ToString();
            txtMakeDate.DateTime    = entity.MakeDate;
            txtSendNo.Text          = entity.SendNo.ToString();
            drpTransComID.EditValue = entity.TransComID;
            txtTransFee.Text        = entity.TransFee.ToString();
            txtRLFee.Text           = entity.RLFee.ToString();
            txtShopID.Text          = entity.ShopID;
            txtTHFee.Text           = entity.THFee.ToString();
            txtTHAddress.Text       = entity.THAddress.ToString();
            drpVendorID.EditValue   = entity.VendorID;
            txtRecAddress.Text      = entity.RecAddress.ToString();
            drpYSFlag.EditValue     = entity.YSFlag;
            txtYSTime.Text          = entity.YSTime.ToString();
            txtRemark.Text          = entity.Remark.ToString();
            txtFLC.Text             = entity.FLC.ToString();
            txtFSHSJD.Text          = entity.FDT.ToString();
            txtFSHSJD.Text          = entity.FSHSJD.ToString();
            txtFHWZZ.Text           = entity.FHWZZ.ToString();
            drpFDTJ.EditValue       = entity.FDTJ;
            drpFDT.EditValue        = entity.FDT;
            drpFHDFlag.EditValue    = entity.FHDFlag;
            txtFHDDate.DateTime     = entity.FHDDate;
            drpJSFlag.EditValue     = entity.JSFlag;
            txtJSDate.DateTime      = entity.JSDate;
            txtJSFee.Text           = entity.JSFee.ToString();
            txtJSRemark.Text        = entity.JSRemark.ToString();
            txtOtherFee.Text        = entity.OtherFee.ToString();
            txtTotalAmount.Text     = entity.TotalAmount.ToString();
            txtSJFHDate.DateTime    = entity.SJFHDate;
            txtTotalPieceQty.Text   = entity.TotalPieceQty.ToString();
            txtQty.Text             = entity.TotalQty.ToString();

            HTDataSubmitFlag = entity.SubmitFlag;
            HTDataDelFlag    = entity.DelFlag;
            if (!findFlag)
            {
            }

            BindGridDts();
        }
예제 #8
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="p_BE">要删除的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         GoodsTrans    entity  = (GoodsTrans)p_BE;
         GoodsTransCtl control = new GoodsTransCtl(sqlTrans);
         control.Delete(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
예제 #9
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            GoodsTransRule rule   = new GoodsTransRule();
            GoodsTrans     entity = EntityGet();

            GoodsTransDts[] entitydts     = EntityDtsGet();
            decimal         totalpieceqty = 0;
            decimal         totalqty      = 0;

            for (int i = 0; i < entitydts.Length; i++)
            {
                totalpieceqty += entitydts[i].PieceQty;
                totalqty      += entitydts[i].Qty;
            }
            entity.TotalPieceQty = totalpieceqty;
            entity.TotalQty      = totalqty;
            entity.SubmitFlag    = this.HTSubmitFlagUpdateGet();
            rule.RUpdate(entity, entitydts);
        }
예제 #10
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         GoodsTrans    entity  = (GoodsTrans)p_BE;
         GoodsTransCtl control = new GoodsTransCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Att_GoodsTrans, sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
예제 #11
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            GoodsTransRule rule   = new GoodsTransRule();
            GoodsTrans     entity = EntityGet();

            GoodsTransDts[] entitydts     = EntityDtsGet();
            decimal         totalpieceqty = 0;
            decimal         totalqty      = 0;

            for (int i = 0; i < entitydts.Length; i++)
            {
                totalpieceqty += entitydts[i].PieceQty;
                totalqty      += entitydts[i].Qty;
            }
            entity.TotalPieceQty = totalpieceqty;
            entity.TotalQty      = totalqty;
            entity.SubmitFlag    = this.HTSubmitFlagInsertGet();
            rule.RAdd(entity, entitydts);
            return(entity.ID);
        }
예제 #12
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private GoodsTrans EntityGet()
        {
            GoodsTrans entity = new GoodsTrans();

            entity.ID = HTDataID;
            entity.SelectByID();

            entity.FormNo      = txtFormNo.Text.Trim();
            entity.MakeOPID    = FParamConfig.LoginID;
            entity.MakeOPName  = FParamConfig.LoginName;
            entity.MakeDate    = txtMakeDate.DateTime.Date;
            entity.SendNo      = txtSendNo.Text.Trim();
            entity.TransComID  = SysConvert.ToString(drpTransComID.EditValue);
            entity.TransFee    = SysConvert.ToDecimal(txtTransFee.Text.Trim());
            entity.RLFee       = SysConvert.ToDecimal(txtRLFee.Text.Trim());
            entity.THFee       = SysConvert.ToDecimal(txtTHFee.Text.Trim());
            entity.THAddress   = txtTHAddress.Text.Trim();
            entity.VendorID    = SysConvert.ToString(drpVendorID.EditValue);
            entity.RecAddress  = txtRecAddress.Text.Trim();
            entity.YSFlag      = SysConvert.ToInt32(drpYSFlag.EditValue);
            entity.YSTime      = SysConvert.ToDecimal(txtYSTime.Text.Trim());
            entity.Remark      = txtRemark.Text.Trim();
            entity.FLC         = SysConvert.ToInt32(txtFLC.Text.Trim());
            entity.FDT         = SysConvert.ToInt32(drpFDT.EditValue);
            entity.FSHSJD      = txtFSHSJD.Text.Trim();
            entity.FHWZZ       = SysConvert.ToDecimal(txtFHWZZ.Text.Trim());
            entity.FDTJ        = SysConvert.ToInt32(drpFDTJ.EditValue);
            entity.FHDFlag     = SysConvert.ToInt32(drpFHDFlag.EditValue);
            entity.FHDDate     = txtFHDDate.DateTime.Date;
            entity.JSFlag      = SysConvert.ToInt32(drpJSFlag.EditValue);
            entity.JSDate      = txtJSDate.DateTime.Date;
            entity.JSFee       = SysConvert.ToDecimal(txtJSFee.Text.Trim());
            entity.JSRemark    = txtJSRemark.Text.Trim();
            entity.ShopID      = txtShopID.Text.Trim();
            entity.OtherFee    = SysConvert.ToDecimal(txtOtherFee.Text.Trim());
            entity.TotalAmount = entity.OtherFee + entity.THFee + entity.RLFee + entity.TransFee;
            entity.SJFHDate    = txtSJFHDate.DateTime.Date;
            return(entity);
        }
예제 #13
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                GoodsTrans MasterEntity = (GoodsTrans)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Att_GoodsTrans(");
                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("SendNo" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.SendNo) + ",");
                MasterField.Append("TransComID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.TransComID) + ",");
                MasterField.Append("TransFee" + ",");
                if (MasterEntity.TransFee != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.TransFee) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("RLFee" + ",");
                if (MasterEntity.RLFee != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.RLFee) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("ShopID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ShopID) + ",");
                MasterField.Append("THFee" + ",");
                if (MasterEntity.THFee != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.THFee) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("THAddress" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.THAddress) + ",");
                MasterField.Append("VendorID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.VendorID) + ",");
                MasterField.Append("RecAddress" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.RecAddress) + ",");
                MasterField.Append("YSFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.YSFlag) + ",");
                MasterField.Append("YSTime" + ",");
                if (MasterEntity.YSTime != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.YSTime) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("Remark" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ",");
                MasterField.Append("FLC" + ",");
                if (MasterEntity.FLC != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.FLC) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("FDT" + ",");
                if (MasterEntity.FDT != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.FDT) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("FSHSJD" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.FSHSJD) + ",");
                MasterField.Append("FHWZZ" + ",");
                if (MasterEntity.FHWZZ != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.FHWZZ) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("FDTJ" + ",");
                if (MasterEntity.FDTJ != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.FDTJ) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("FHDFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.FHDFlag) + ",");
                MasterField.Append("FHDDate" + ",");
                if (MasterEntity.FHDDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.FHDDate.ToString("yyyy-MM-dd HH:mm:ss")) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("JSFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.JSFlag) + ",");
                MasterField.Append("JSDate" + ",");
                if (MasterEntity.JSDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.JSDate.ToString("yyyy-MM-dd HH:mm:ss")) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("JSFee" + ",");
                if (MasterEntity.JSFee != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.JSFee) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("JSRemark" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.JSRemark) + ",");
                MasterField.Append("OtherFee" + ",");
                if (MasterEntity.OtherFee != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.OtherFee) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("TotalAmount" + ",");
                if (MasterEntity.TotalAmount != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.TotalAmount) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("TotalPieceQty" + ",");
                if (MasterEntity.TotalPieceQty != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.TotalPieceQty) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("TotalQty" + ",");
                if (MasterEntity.TotalQty != 0)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.TotalQty) + ",");
                }
                else
                {
                    MasterValue.Append("null,");
                }

                MasterField.Append("SJFHDate" + ")");
                if (MasterEntity.SJFHDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    MasterValue.Append(SysString.ToDBString(MasterEntity.SJFHDate.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);
            }
        }
예제 #14
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                GoodsTrans MasterEntity = (GoodsTrans)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Att_GoodsTrans 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(" SendNo=" + SysString.ToDBString(MasterEntity.SendNo) + ",");
                UpdateBuilder.Append(" TransComID=" + SysString.ToDBString(MasterEntity.TransComID) + ",");

                if (MasterEntity.TransFee != 0)
                {
                    UpdateBuilder.Append(" TransFee=" + SysString.ToDBString(MasterEntity.TransFee) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" TransFee=null,");
                }


                if (MasterEntity.RLFee != 0)
                {
                    UpdateBuilder.Append(" RLFee=" + SysString.ToDBString(MasterEntity.RLFee) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" RLFee=null,");
                }

                UpdateBuilder.Append(" ShopID=" + SysString.ToDBString(MasterEntity.ShopID) + ",");

                if (MasterEntity.THFee != 0)
                {
                    UpdateBuilder.Append(" THFee=" + SysString.ToDBString(MasterEntity.THFee) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" THFee=null,");
                }

                UpdateBuilder.Append(" THAddress=" + SysString.ToDBString(MasterEntity.THAddress) + ",");
                UpdateBuilder.Append(" VendorID=" + SysString.ToDBString(MasterEntity.VendorID) + ",");
                UpdateBuilder.Append(" RecAddress=" + SysString.ToDBString(MasterEntity.RecAddress) + ",");
                UpdateBuilder.Append(" YSFlag=" + SysString.ToDBString(MasterEntity.YSFlag) + ",");

                if (MasterEntity.YSTime != 0)
                {
                    UpdateBuilder.Append(" YSTime=" + SysString.ToDBString(MasterEntity.YSTime) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" YSTime=null,");
                }

                UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ",");

                if (MasterEntity.FLC != 0)
                {
                    UpdateBuilder.Append(" FLC=" + SysString.ToDBString(MasterEntity.FLC) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" FLC=null,");
                }


                if (MasterEntity.FDT != 0)
                {
                    UpdateBuilder.Append(" FDT=" + SysString.ToDBString(MasterEntity.FDT) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" FDT=null,");
                }

                UpdateBuilder.Append(" FSHSJD=" + SysString.ToDBString(MasterEntity.FSHSJD) + ",");

                if (MasterEntity.FHWZZ != 0)
                {
                    UpdateBuilder.Append(" FHWZZ=" + SysString.ToDBString(MasterEntity.FHWZZ) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" FHWZZ=null,");
                }


                if (MasterEntity.FDTJ != 0)
                {
                    UpdateBuilder.Append(" FDTJ=" + SysString.ToDBString(MasterEntity.FDTJ) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" FDTJ=null,");
                }

                UpdateBuilder.Append(" FHDFlag=" + SysString.ToDBString(MasterEntity.FHDFlag) + ",");

                if (MasterEntity.FHDDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    UpdateBuilder.Append(" FHDDate=" + SysString.ToDBString(MasterEntity.FHDDate.ToString("yyyy-MM-dd HH:mm:ss")) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" FHDDate=null,");
                }

                UpdateBuilder.Append(" JSFlag=" + SysString.ToDBString(MasterEntity.JSFlag) + ",");

                if (MasterEntity.JSDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    UpdateBuilder.Append(" JSDate=" + SysString.ToDBString(MasterEntity.JSDate.ToString("yyyy-MM-dd HH:mm:ss")) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" JSDate=null,");
                }


                if (MasterEntity.JSFee != 0)
                {
                    UpdateBuilder.Append(" JSFee=" + SysString.ToDBString(MasterEntity.JSFee) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" JSFee=null,");
                }

                UpdateBuilder.Append(" JSRemark=" + SysString.ToDBString(MasterEntity.JSRemark) + ",");

                if (MasterEntity.OtherFee != 0)
                {
                    UpdateBuilder.Append(" OtherFee=" + SysString.ToDBString(MasterEntity.OtherFee) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" OtherFee=null,");
                }


                if (MasterEntity.TotalAmount != 0)
                {
                    UpdateBuilder.Append(" TotalAmount=" + SysString.ToDBString(MasterEntity.TotalAmount) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" TotalAmount=null,");
                }


                if (MasterEntity.TotalPieceQty != 0)
                {
                    UpdateBuilder.Append(" TotalPieceQty=" + SysString.ToDBString(MasterEntity.TotalPieceQty) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" TotalPieceQty=null,");
                }


                if (MasterEntity.TotalQty != 0)
                {
                    UpdateBuilder.Append(" TotalQty=" + SysString.ToDBString(MasterEntity.TotalQty) + ",");
                }
                else
                {
                    UpdateBuilder.Append(" TotalQty=null,");
                }


                if (MasterEntity.SJFHDate != SystemConfiguration.DateTimeDefaultValue)
                {
                    UpdateBuilder.Append(" SJFHDate=" + SysString.ToDBString(MasterEntity.SJFHDate.ToString("yyyy-MM-dd HH:mm:ss")));
                }
                else
                {
                    UpdateBuilder.Append(" SJFHDate=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);
            }
        }
예제 #15
0
 /// <summary>
 /// 检查将要操作的数据是否符合业务规则
 /// </summary>
 /// <param name="p_BE"></param>
 private void CheckCorrect(BaseEntity p_BE)
 {
     GoodsTrans entity = (GoodsTrans)p_BE;
 }