Exemple #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);
         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);
     }
 }
Exemple #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);
                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);
            }
        }
Exemple #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);
                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);
            }
        }
        /// <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);
            }
        }
Exemple #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);
         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);
     }
 }
Exemple #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);
                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);
            }
        }
Exemple #7
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);
     }
 }
        /// <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);
            }
        }
 /// <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);
     }
 }
Exemple #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);
                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);
            }
        }
Exemple #11
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);
            }
        }
 /// <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);
     }
 }
 /// <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);
     }
 }
Exemple #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);
                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);
            }
        }
        /// <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);
            }
        }
        /// <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);
            }
        }
Exemple #17
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);
            }
        }
Exemple #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);
         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);
     }
 }
Exemple #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);
         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);
     }
 }
Exemple #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);
         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);
     }
 }
Exemple #21
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);
            }
        }
Exemple #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);
            }
        }
Exemple #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);
                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);
            }
        }
        /// <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);
            }
        }
        /// <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);
            }
        }
Exemple #26
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);
            }
        }
        /// <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);
            }
        }
Exemple #28
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);
                PackBox    entity  = (PackBox)p_BE;
                PackBoxCtl control = new PackBoxCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.WH_PackBox, sqlTrans);
                if (entity.BoxNo == string.Empty)//条码号不存在
                {
                    entity.CreateTime = DateTime.Now;

                    FormNoControlRule rulest = new FormNoControlRule();

                    //处理生成箱号
                    entity.BoxNo = rulest.RGetFormNo((int)FormNoControlEnum.码单箱号, sqlTrans);
                    rulest.RAddSort((int)FormNoControlEnum.码单箱号, sqlTrans);
                }
                else//已存在
                {
                    string sql = "SELECT BoxNo FROM WH_PackBox WHERE BoxNo=" + SysString.ToDBString(entity.BoxNo);
                    if (sqlTrans.Fill(sql).Rows.Count != 0)//条码号已存在,则生成新条码
                    {
                        entity.CreateTime = DateTime.Now;

                        FormNoControlRule rulest = new FormNoControlRule();

                        //处理生成箱号
                        entity.BoxNo = rulest.RGetFormNo((int)FormNoControlEnum.码单箱号, sqlTrans);
                        rulest.RAddSort((int)FormNoControlEnum.码单箱号, sqlTrans);
                    }
                }

                control.AddNew(entity);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Exemple #29
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);
                GZNote    entity  = (GZNote)p_BE;
                GZNoteCtl control = new GZNoteCtl(sqlTrans);
                string    sql     = "SELECT FormNo FROM Data_GZNote WHERE FormNo=" + SysString.ToDBString(entity.FormNo);
                DataTable dt      = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("报告编号已存在,请重新生成");
                }
                sql  = "SELECT * FROM Data_GZNote WHERE FormDate=" + SysString.ToDBString(entity.FormDate);
                sql += " AND OPID=" + SysString.ToDBString(entity.OPID);
                dt   = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("该时间的工作日报已存在,请检查");
                }
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Data_GZNote, sqlTrans);
                control.AddNew(entity);

                for (int i = 0; i < p_BE2.Length; i++)
                {
                    GZNoteDtsRule rule      = new GZNoteDtsRule();
                    GZNoteDts     entityDts = (GZNoteDts)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);
            }
        }
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd(BaseEntity p_BE, 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);



                ///回填生产通知单总数量
                if (entity.ProductionID != 0)
                {
                    //sql = "select SUM(ISNULL(TotalQty,0)) TotalQty from WO_FabricProcess where 1=1";
                    //sql += " AND ProductionID=" + entity.ProductionID;
                    //DataTable dtP = sqlTrans.Fill(sql);
                    //if(dtP.Rows.Count!=0)
                    //{

                    //}
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }