Esempio n. 1
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);
         ItemGB    entity  = (ItemGB)p_BE;
         ItemGBCtl control = new ItemGBCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_ItemGB, sqlTrans);
         FormNoControlRule rule = new FormNoControlRule();
         //entity.GBCode= rule.RGetFormNo((int)FormNoControlEnum.挂板单号);
         string    sql = "SELECT GBCode FROM Data_ItemGB WHERE GBCode=" + SysString.ToDBString(entity.GBCode);
         DataTable dt  = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("挂板条码号已存在,请检查后操作");
         }
         control.AddNew(entity);
         rule.RAddSort((int)FormNoControlEnum.挂板单号, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 2
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);
                ItemBuyForm entity = (ItemBuyForm)p_BE;

                string    sql = "SELECT FormNo FROM Buy_ItemBuyForm WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("采购单号已存在,请重新生成");
                }
                ItemBuyFormCtl control = new ItemBuyFormCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Buy_ItemBuyForm, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule fnrule = new FormNoControlRule();
                fnrule.RAddSort("Buy_ItemBuyForm", "FormNo", entity.FormAID, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 3
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);
         GoodsPost entity = (GoodsPost)p_BE;
         string    sql    = "SELECT FormNo FROM Att_GoodsPost WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable dt     = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("单号已存在,请重新生成");
         }
         GoodsPostCtl control = new GoodsPostCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Att_GoodsPost, sqlTrans);
         control.AddNew(entity);
         FormNoControlRule rulest = new FormNoControlRule();
         //rulest.RAddSort((int)FormNoControlEnum.快递单号, sqlTrans);
         rulest.RAddSort("Att_GoodsPost", "FormNo", 0, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 4
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);
                QuotedPrice entity = (QuotedPrice)p_BE;
                string      sql    = "SELECT FormNo FROM  Sale_QuotedPrice  WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable   dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("报价单号已存在,请重新生成");
                }

                QuotedPriceCtl control = new QuotedPriceCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Sale_QuotedPrice, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule rule = new FormNoControlRule();
                rule.RAddSort((int)FormNoControlEnum.报价单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 5
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);
                CheckForm    entity  = (CheckForm)p_BE;
                CheckFormCtl control = new CheckFormCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.ADH_CheckForm, sqlTrans);

                string    sql = "SELECT FormCode FROM ADH_CheckForm WHERE FormCode=" + SysString.ToDBString(entity.FormCode);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }


                control.AddNew(entity);

                FormNoControlRule prule = new FormNoControlRule();

                prule.RAddSort((int)FormNoControlEnum.样品报价单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 6
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);
         SBit    entity  = (SBit)p_BE;
         SBitCtl control = new SBitCtl(sqlTrans);
         //entity.ID=EntityIDTable.GetID((long)SysEntity.WH_SBit,sqlTrans);
         string    sql = "SELECT SBitID FROM WH_SBit WHERE SBitID=" + SysString.ToDBString(entity.SBitID) + " AND SectionID=" + SysString.ToDBString(entity.SectionID) + " AND WHID=" + SysString.ToDBString(entity.WHID);
         DataTable dt  = SysUtils.Fill(sql);
         if (dt.Rows.Count != 0)
         {
             throw new Exception("该仓库位编码已经存在,请重新输入");
         }
         FormNoControlRule rule = new FormNoControlRule();
         entity.SBitISN = rule.RGetFormNo(1026, sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 7
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);
                SampleSODts    entity  = (SampleSODts)p_BE;
                SampleSODtsCtl control = new SampleSODtsCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Dev_SampleSODts, sqlTrans);

                //if (entity.DesignNo == string.Empty)
                //{
                FormNoControlRule fnrule   = new FormNoControlRule();
                string            formcode = fnrule.RGetFormNo("Dev_SampleSODts", "DesignNo", sqlTrans);
                entity.DesignNo = formcode;
                fnrule.RAddSort("Dev_SampleSODts", "DesignNo", sqlTrans);
                //}

                control.AddNew(entity);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 8
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);
                ColorCard entity = (ColorCard)p_BE;

                string    sql = "SELECT FormNo FROM Dev_ColorCard WHERE FormNo=" + SysString.ToDBString(entity.FormNO);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }

                ColorCardCtl control = new ColorCardCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Dev_ColorCard, sqlTrans);
                control.AddNew(entity);



                FormNoControlRule fnrule = new FormNoControlRule();
                fnrule.RAddSort("Dev_ColorCard", "FormNo", 0, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 9
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);
                ProductionNotice entity = (ProductionNotice)p_BE;

                string    sql = "SELECT FormNo FROM Sale_ProductionNotice WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt  = SysUtils.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请检查");
                }
                ProductionNoticeCtl control = new ProductionNoticeCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Sale_ProductionNotice, sqlTrans);
                control.AddNew(entity);

                ProductionNoticeDtsRule procedureRule = new ProductionNoticeDtsRule();
                procedureRule.RSave(entity, p_BE2, sqlTrans);//保存流程明细

                FormNoControlRule frule = new FormNoControlRule();
                frule.RAddSort((int)FormNoControlEnum.生产通知单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 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);
         ItemBuyFollow entity = (ItemBuyFollow)p_BE;
         string        sql    = "SELECT FormNo FROM Buy_ItemBuyFollow WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable     dt     = SysUtils.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("跟单单号已存在,请重新生成");
         }
         //sql = "SELECT BuyFormNo FROM Buy_ItemBuyFollow WHERE BuyFormNo="+SysString.ToDBString(entity.BuyFormNo);
         sql = "SELECT DLoadDtsID FROM Buy_ItemBuyFollow WHERE DLoadDtsID=" + SysString.ToDBString(entity.DLoadDtsID);
         dt  = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("该采购合同已跟单,请检查");
         }
         ItemBuyFollowCtl control = new ItemBuyFollowCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Buy_ItemBuyFollow, sqlTrans);
         control.AddNew(entity);
         FormNoControlRule rulest = new FormNoControlRule();
         rulest.RAddSort((int)FormNoControlEnum.跟单单号, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 11
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);
     }
 }
Esempio n. 12
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);
                VendorTrackRecord entity = (VendorTrackRecord)p_BE;

                string    sql = "SELECT FormNo FROM Att_VendorTrackRecord WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }


                VendorTrackRecordCtl control = new VendorTrackRecordCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Att_VendorTrackRecord, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule rulest = new FormNoControlRule();
                rulest.RAddSort("Att_VendorTrackRecord", "FormNo", sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 13
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);
         TestReport    entity  = (TestReport)p_BE;
         TestReportCtl control = new TestReportCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Dev_Sample, sqlTrans);
         string    sql = "SELECT FormNo FROM WO_TestReport WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable dt  = sqlTrans.Fill(sql);
         if (dt.Rows.Count != 0)
         {
             throw new Exception("此单号已存在,请重新生成");
         }
         FormNoControlRule fnrule = new FormNoControlRule();
         fnrule.RAddSort("WO_TestReport", "FormNo", sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 14
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);
                YQForm    entity  = (YQForm)p_BE;
                YQFormCtl control = new YQFormCtl(sqlTrans);
                string    sql     = "SELECT FormNo FROM WH_YQForm WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt      = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("溢缺单号已存在,请双击单号重新生成");
                }
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WH_YQForm, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule rule = new FormNoControlRule();
                rule.RAddSort((int)FormNoControlEnum.溢缺单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 15
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);
         GBJC      entity = (GBJC)p_BE;
         string    sql    = "SELECT FormNo FROM Dev_GBJC WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable dt     = SysUtils.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("挂板借出单号已存在,请重新生成");
         }
         GBJCCtl control = new GBJCCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Dev_GBJC, sqlTrans);
         control.AddNew(entity);
         FormNoControlRule rulest = new FormNoControlRule();
         rulest.RAddSort((int)FormNoControlEnum.挂板借出单号, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 16
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd(int p_ID, decimal p_Qty, string p_OPID, IDBTransAccess sqlTrans)
        {
            try
            {
                PackBoxKPRule rule   = new PackBoxKPRule();
                PackBox       entity = new PackBox(sqlTrans);
                entity.ID = p_ID;
                entity.SelectByID();

                FormNoControlRule frule   = new FormNoControlRule();
                PackBoxKP         pentity = new PackBoxKP();
                pentity.FormNo    = frule.RGetFormNo((int)FormNoControlEnum.开匹单号, sqlTrans);
                pentity.FormDate  = DateTime.Now;
                pentity.MakeDate  = DateTime.Now;
                pentity.MakeOPID  = p_OPID;
                pentity.SaleOPID  = p_OPID;
                pentity.KPOPID    = p_OPID;
                pentity.BoxNo     = entity.BoxNo;
                pentity.Qty       = entity.Qty;
                pentity.TargetQty = p_Qty;

                rule.RAdd(pentity, sqlTrans);

                rule.RSubmit(pentity.ID, 1, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 17
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RSave(string p_OrderFormNo, BaseEntity[] p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         FormNoControlRule rule = new FormNoControlRule();
         string            sql  = "DELETE FROM Finance_PaymentHandle WHERE OrderFormNo =" + SysString.ToDBString(p_OrderFormNo);
         sql += " AND ID NOT IN" + string.Format("({0})", GetIDExist(p_BE));
         sqlTrans.ExecuteNonQuery(sql);
         for (int i = 0; i < p_BE.Length; i++)
         {
             PaymentHandle entitydts = (PaymentHandle)p_BE[i];
             if (entitydts.ID > 0)
             {
                 this.RUpdate(entitydts, sqlTrans);
             }
             else
             {
                 string FormNo = rule.RGetFormNo("Finance_PaymentHandle", "FormNo", sqlTrans);
                 entitydts.FormNo = FormNo;
                 this.RAdd(entitydts, sqlTrans);
                 rule.RAddSort("Finance_PaymentHandle", "FormNo", sqlTrans);
             }
         }
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 18
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);
                OP        entity = (OP)p_BE;
                string    sql    = "SELECT * FROM Data_OP WHERE OPID=" + SysString.ToDBString(entity.OPID);
                DataTable dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("员工编号已存在,请检查后重新输入");
                }
                sql = "SELECT * FROM Data_OP WHERE OPName=" + SysString.ToDBString(entity.OPName);
                dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("员工已存在,请检查后重新输入");
                }
                OPCtl control = new OPCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_OP, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule fnrule = new FormNoControlRule();
                fnrule.RAddSort("Data_OP", "OPID", 0, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 19
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);
                SaleOrderInstruct entity = (SaleOrderInstruct)p_BE;

                string    sql = "SELECT FormNo FROM Sale_SaleOrderInstruct WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请双击重新生成单号");
                }

                SaleOrderInstructCtl control = new SaleOrderInstructCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Sale_HandleEvent, sqlTrans);
                control.AddNew(entity);



                FormNoControlRule rulest = new FormNoControlRule();
                rulest.RAddSort("Sale_SaleOrderInstruct", "FormNo", 0, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 20
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);
                CheckOperation entity = (CheckOperation)p_BE;
                string         sql    = "SELECT FormNo FROM Finance_CheckOperation WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable      dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("对账单号已存在,请重新生成");
                }
                CheckOperationCtl control = new CheckOperationCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Finance_CheckOperation, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule rulest = new FormNoControlRule();
                rulest.RAddSort((int)FormNoControlEnum.对账单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 21
0
 /// <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);
     }
 }
Esempio n. 22
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);
                Item      entity = (Item)p_BE;
                string    sql    = "SELECT ItemCode FROM Data_Item WHERE ItemCode=" + SysString.ToDBString(entity.ItemCode);
                DataTable dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("编码已存在,请重新生成");
                }

                ItemCtl control = new ItemCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_Item, sqlTrans);
                control.AddNew(entity);


                FormNoControlRule fnrule = new  FormNoControlRule();
                fnrule.RAddSort("Data_Item", "ItemCode", entity.ItemTypeID, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 23
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);
                SendSample entity = (SendSample)p_BE;
                string     sql    = "SELECT * FROM Sale_SendSample WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable  dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请双击单号重新生成!");
                }
                SendSampleCtl control = new SendSampleCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Sale_SendSample, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule frule = new FormNoControlRule();
                frule.RAddSort((int)FormNoControlEnum.寄样编号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 24
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);
         StorgeJS  entity = (StorgeJS)p_BE;
         string    sql    = "SELECT * FROM WH_StorgeJS WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
         DataTable dt     = sqlTrans.Fill(sql);
         if (dt.Rows.Count > 0)
         {
             throw new BaseException("单号已存在,请检查后重新输入!");    // 检查是否已存在
         }
         StorgeJSCtl control = new StorgeJSCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WH_StorgeJS, sqlTrans);
         control.AddNew(entity);
         FormNoControlRule rulest = new FormNoControlRule();
         rulest.RAddSort((int)FormNoControlEnum.结算单号, sqlTrans);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Esempio n. 25
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);
                Vendor entity = (Vendor)p_BE;


                string    sql = "SELECT ID FROM Data_Vendor WHERE VendorID=" + SysString.ToDBString(entity.VendorID);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("客户编码已存在,请检查后重新输入");
                }
                sql = "SELECT ID FROM Data_Vendor WHERE VendorAttn=" + SysString.ToDBString(entity.VendorAttn);
                dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("客户简称已存在,请检查后重新输入");
                }
                sql = "SELECT ID FROM Data_Vendor WHERE VendorName=" + SysString.ToDBString(entity.VendorName);
                dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("客户全称已存在,请检查后重新输入");
                }


                sql  = "SELECT ID FROM Data_Vendor WHERE QQ=" + SysString.ToDBString(entity.QQ);
                sql += " AND ISNULL(QQ,'')<>''";
                dt   = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("客户QQ已存在,请检查后重新输入");
                }
                sql  = "SELECT ID FROM Data_Vendor WHERE Address=" + SysString.ToDBString(entity.Address);
                sql += " AND ISNULL(Address,'')<>''";
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("客户地址已存在,请检查后重新输入");
                }


                VendorCtl control = new VendorCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_Vendor, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule fnrule = new FormNoControlRule();
                fnrule.RAddSort("Data_Vendor", "VendorID", entity.VendorTypeID, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 26
0
        /// <summary>
        /// 扫描数据(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public int RScan(int p_ID, string p_ISN, int p_YPQty, string p_Vendorid, int p_ZHID, DateTime p_Time, IDBTransAccess sqlTrans)
        {
            int outi = 0;

            try
            {
                CheckForm entity = new CheckForm(sqlTrans);
                if (p_ID == 0)
                {
                    FormNoControlRule prule = new FormNoControlRule();

                    //entity.FormCode = prule.RGetFormNo("ADH_CheckForm", "FormCode", sqlTrans);

                    entity.FormCode = prule.RGetFormNo((int)FormNoControlEnum.样品报价单号);

                    entity.DVendorID = p_Vendorid;
                    entity.FormDate  = DateTime.Now;
                    entity.DataDHID  = p_ZHID;
                    entity.BJHL      = 1;
                    this.RAdd(entity, sqlTrans);
                    outi = entity.ID;
                    CheckFormDtsRule dtsrule = new CheckFormDtsRule();
                    dtsrule.RScan(entity.ID, p_ISN, p_YPQty, p_Time, sqlTrans);
                }
                else
                {
                    outi      = p_ID;
                    entity.ID = p_ID;
                    if (entity.SelectByID())//找到订货单
                    {
                        if (entity.SubmitFlag == (int)YesOrNo.Yes)
                        {
                            throw new Exception("单据已完成,不能操作");
                        }

                        CheckFormDtsRule dtsrule = new CheckFormDtsRule();
                        dtsrule.RScan(entity.ID, p_ISN, p_YPQty, p_Time, sqlTrans);
                    }
                }


                //记录扫描历史
                string sql = string.Empty;
                sql = "INSERT INTO ADH_ScanHis(ISN,DataDHID,DVendorID) VALUES(" + SysString.ToDBString(p_ISN) + "," + SysString.ToDBString(p_ZHID) + "," + SysString.ToDBString(p_Vendorid) + ")";
                sqlTrans.ExecuteNonQuery(sql);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
            return(outi);
        }
Esempio n. 27
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd(BaseEntity p_BE, BaseEntity p_BEAdd, BaseEntity[] p_BE2, BaseEntity[] p_BE3, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);
                FabricProcess    entity  = (FabricProcess)p_BE;
                FabricProcessCtl control = new FabricProcessCtl(sqlTrans);
                string           sql     = "SELECT FormNo FROM WO_FabricProcess WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable        dt      = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WO_FabricProcess, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule fnrule = new FormNoControlRule();
                fnrule.RAddSort("WO_FabricProcess", "FormNo", entity.ProcessTypeID, sqlTrans);

                FabricProcessAddRule ruleAdd   = new FabricProcessAddRule();
                FabricProcessAdd     entityAdd = (FabricProcessAdd)p_BEAdd;
                entityAdd.ID = entity.ID;
                ruleAdd.RAdd(entityAdd, sqlTrans);


                for (int i = 0; i < p_BE2.Length; i++)
                {
                    FabricProcessDtsRule rule      = new FabricProcessDtsRule();
                    FabricProcessDts     entityDts = (FabricProcessDts)p_BE2[i];
                    entityDts.MainID = entity.ID;
                    entityDts.Seq    = i + 1;
                    rule.RAdd(entityDts, sqlTrans);
                }

                for (int i = 0; i < p_BE3.Length; i++)
                {
                    FabricProcessPBDtsRule rule      = new FabricProcessPBDtsRule();
                    FabricProcessPBDts     entityDts = (FabricProcessPBDts)p_BE3[i];
                    entityDts.MainID = entity.ID;
                    entityDts.Seq    = i + 1;
                    rule.RAdd(entityDts, sqlTrans);
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 28
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);
                FHForm    entity = (FHForm)p_BE;
                string    sql    = "SELECT FormNo FROM Sale_FHForm WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }

                //sql = "SELECT SendCode FROM Sale_FHForm WHERE SendCode=" + SysString.ToDBString(entity.SendCode);
                //dt = sqlTrans.Fill(sql);
                //if (dt.Rows.Count > 0)
                //{
                //    throw new BaseException("送货单号已存在,请重新生成");
                //}
                FHFormCtl control = new FHFormCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Sale_FHForm, sqlTrans);
                control.AddNew(entity);

                FHFormDtsRule rule = new FHFormDtsRule();
                for (int i = 0; i < p_BE2.Length; i++)
                {
                    FHFormDts entityDts = (FHFormDts)p_BE2[i];
                    entityDts.MainID = entity.ID;
                    entityDts.Seq    = i + 1;
                    rule.RAdd(entityDts, sqlTrans);
                }



                FormNoControlRule rulest = new FormNoControlRule();
                //rulest.RAddSort((int)FormNoControlEnum.发货单号, sqlTrans);
                rulest.RAddSort("Sale_FHForm", "FormNo", 0, sqlTrans);

                //FormNCVendorRule rulencv = new FormNCVendorRule();
                //rulencv.RAddSort((int)FormNoControlEnum.发货单送货单号, (int)EnumFNCV.发货单送货单号, entity.VendorID, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 29
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd2(BaseEntity p_BE, BaseEntity[] p_BE2, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);
                InvoiceOperation entity = (InvoiceOperation)p_BE;
                string           sql    = "SELECT FormNo FROM Finance_InvoiceOperation WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable        dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }

                if (entity.InvoiceNO != "")
                {
                    sql = "SELECT ID FROM Finance_InvoiceOperation WHERE InvoiceNO=" + SysString.ToDBString(entity.InvoiceNO);
                    dt  = sqlTrans.Fill(sql);
                    if (dt.Rows.Count > 0)
                    {
                        throw new BaseException("发票号已存在,请重新输入");
                    }
                }

                InvoiceOperationCtl control = new InvoiceOperationCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Finance_InvoiceOperation, sqlTrans);
                control.AddNew(entity);

                for (int i = 0; i < p_BE2.Length; i++)
                {
                    InvoiceYOperationDtsRule rule      = new InvoiceYOperationDtsRule();
                    InvoiceYOperationDts     entityDts = (InvoiceYOperationDts)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);
            }
        }
Esempio n. 30
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);
                InvoiceOperation entity = (InvoiceOperation)p_BE;
                string           sql    = "SELECT FormNo FROM Finance_InvoiceOperation WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable        dt     = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }
                if (entity.InvoiceNO != "")
                {
                    sql = "SELECT ID FROM Finance_InvoiceOperation WHERE InvoiceNO=" + SysString.ToDBString(entity.InvoiceNO);
                    dt  = sqlTrans.Fill(sql);
                    if (dt.Rows.Count > 0)
                    {
                        throw new BaseException("发票号已存在,请重新输入");
                    }
                }

                InvoiceOperationCtl control = new InvoiceOperationCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Finance_InvoiceOperation, sqlTrans);
                control.AddNew(entity);

                FormNoControlRule rulest = new FormNoControlRule();
                if (entity.DZTypeID == 3)
                {
                    rulest.RAddSort((int)FormNoControlEnum.发票单号, sqlTrans);
                }
                else
                {
                    rulest.RAddSort((int)FormNoControlEnum.发票单号2, sqlTrans);
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }