Beispiel #1
0
        /// <summary>
        /// 新增(纱线从表)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAddYarn(BaseEntity p_BE, BaseEntity[] p_BE2, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);

                Item entity = (Item)p_BE;
                this.RAdd(p_BE, sqlTrans);

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

                ;
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="p_BE3">原料</param>
        /// <param name="p_BE4">颜色</param>
        /// <param name="p_BE5">类别</param>
        /// <param name="p_BE6">物理指标</param>
        /// <param name="p_BE7">替代白坯</param>
        /// <param name="p_BE8">工厂编码及报价</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd(BaseEntity p_BE, BaseEntity[] p_BE3, BaseEntity[] p_BE4, BaseEntity[] p_BE5, BaseEntity[] p_BE6, BaseEntity[] p_BE7, BaseEntity[] p_BE8, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);

                Item entity = (Item)p_BE;
                this.RAdd(p_BE, sqlTrans);

                for (int i = 0; i < p_BE3.Length; i++)
                {
                    ItemDtsRule rule          = new ItemDtsRule();
                    ItemDts     entityItemDts = (ItemDts)p_BE3[i];
                    entityItemDts.MainID = entity.ID;
                    entityItemDts.Seq    = i + 1;
                    rule.RAdd(entityItemDts, sqlTrans);
                }

                for (int i = 0; i < p_BE4.Length; i++)
                {
                    ItemColorDtsRule rule = new ItemColorDtsRule();
                    ItemColorDts     entityItemColorDts = (ItemColorDts)p_BE4[i];
                    entityItemColorDts.MainID = entity.ID;
                    entityItemColorDts.Seq    = i + 1;
                    rule.RAdd(entityItemColorDts, sqlTrans);
                }
                for (int i = 0; i < p_BE5.Length; i++)
                {
                    ItemLBDtsRule rule            = new ItemLBDtsRule();
                    ItemLBDts     entityItemLBDts = (ItemLBDts)p_BE5[i];
                    entityItemLBDts.MainID = entity.ID;
                    entityItemLBDts.Seq    = i + 1;
                    rule.RAdd(entityItemLBDts, sqlTrans);
                }
                if (p_BE6 != null)
                {
                    for (int i = 0; i < p_BE6.Length; i++)
                    {
                        ItemCheckStandardPhyRule rule          = new ItemCheckStandardPhyRule();
                        ItemCheckStandardPhy     entityItemcsp = (ItemCheckStandardPhy)p_BE6[i];
                        entityItemcsp.MainID = entity.ID;
                        entityItemcsp.Seq    = i + 1;
                        rule.RAdd(entityItemcsp, sqlTrans);
                    }
                }

                if (p_BE7 != null)
                {
                    for (int i = 0; i < p_BE7.Length; i++)
                    {
                        ItemGreyFabReplaceRule rule          = new ItemGreyFabReplaceRule();
                        ItemGreyFabReplace     entityItemgfr = (ItemGreyFabReplace)p_BE7[i];
                        entityItemgfr.MainID = entity.ID;
                        entityItemgfr.Seq    = i + 1;
                        rule.RAdd(entityItemgfr, sqlTrans);
                    }
                }

                if (p_BE8 != null)
                {
                    for (int i = 0; i < p_BE8.Length; i++)
                    {
                        ItemCodeFacDtsRule rule          = new ItemCodeFacDtsRule();
                        ItemCodeFacDts     entityItemfac = (ItemCodeFacDts)p_BE8[i];
                        entityItemfac.MainID = entity.ID;
                        entityItemfac.Seq    = i + 1;
                        rule.RAdd(entityItemfac, sqlTrans);
                    }
                }
                //FormNoControlRule rulefSt = new FormNoControlRule();
                //rulefSt.RAddSort((int)FormNoControlEnum.产品编码, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }