Esempio n. 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_BE">要修改的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RUpdate(BaseEntity p_BE, BaseEntity[] p_BE1, IDBTransAccess sqlTrans)
        {
            try
            {
                this.RUpdate(p_BE, sqlTrans);
                string sql = " DELETE FROM ADH_CheckFormDts where MainID=" + ((CheckForm)p_BE).ID;

                sqlTrans.ExecuteNonQuery(sql);
                CheckFormDtsRule rule = new CheckFormDtsRule();
                for (int i = 0; i < p_BE1.Length; i++)
                {
                    CheckFormDts entitydts = p_BE1[i] as CheckFormDts;
                    entitydts.MainID = ((CheckForm)p_BE).ID;
                    entitydts.Seq    = i + 1;
                    rule.RAdd(entitydts, 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 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. 3
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RAdd(BaseEntity p_BE, BaseEntity[] p_BE1, IDBTransAccess sqlTrans)
 {
     try
     {
         this.RAdd(p_BE, sqlTrans);
         CheckFormDtsRule rule = new CheckFormDtsRule();
         for (int i = 0; i < p_BE1.Length; i++)
         {
             CheckFormDts entitydts = p_BE1[i] as CheckFormDts;
             entitydts.MainID = ((CheckForm)p_BE).ID;
             entitydts.Seq    = i + 1;
             rule.RAdd(entitydts, sqlTrans);
         }
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }