Пример #1
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = EntityGet();

            rule.RAdd(entity);
            return(entity.ID);
        }
Пример #2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTDataID == 0)
                {
                    this.ShowMessage("面料数据没有保存,请检查!");
                    return;
                }
                ItemRule rule   = new ItemRule();
                Item     entity = new Item();
                entity.ID = HTDataID;
                entity.SelectByID();

                if (entity.GreyFabItemCode != "")
                {
                    this.ShowMessage("坯布信息已关联,请检查!");
                    return;
                }

                ItemRule p_rule   = new ItemRule();
                Item     p_entity = new Item();
                p_entity.ItemCode    = "G" + entity.ItemCode;
                p_entity.ItemName    = entity.ItemName;
                p_entity.ItemStd     = entity.ItemStd;
                p_entity.ItemModel   = entity.ItemModel;
                p_entity.ItemModelEn = entity.ItemModelEn;
                p_entity.UseableFlag = entity.UseableFlag;
                p_entity.MWeight     = entity.MWeight;
                p_entity.MWeight2    = entity.MWeight2;
                p_entity.FK          = entity.FK;
                p_entity.ItemUnit    = entity.ItemUnit;
                p_entity.ItemDate    = DateTime.Now.Date;

                p_entity.MWidth     = entity.MWidth;
                p_entity.Remark     = entity.Remark;
                p_entity.ItemTypeID = (int)EnumItemType.坯布;
                p_rule.RAdd(p_entity);

                entity.GreyFabItemCode = p_entity.ItemCode;
                rule.RUpdate(entity);
                txtGreyItemDes.Text     = Common.GetItemDesc(p_entity.ItemCode);
                txtGreyFabItemCode.Text = p_entity.ItemCode;



                this.ShowInfoMessage("坯布生成成功!");
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #3
0
        //public bool CheckCorrectItemDts()
        //{
        //    decimal Percentage = 0;
        //    int Num = 0;
        //    for (int i = 0; i < gridView2.RowCount; i++)
        //    {
        //        if (SysConvert.ToString(gridView2.GetRowCellValue(i, "DtsItemCode")) != string.Empty)
        //        {
        //            Percentage += SysConvert.ToDecimal(gridView2.GetRowCellValue(i, "Percentage"));
        //            Num++;
        //        }
        //    }
        //    if (Num > 0)
        //    {
        //        if (Percentage != 100 && Percentage != 200)
        //        {
        //            return false;
        //        }
        //    }
        //    return true;
        //}

        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            //ItemGB[] entityItemGB = GetItemGB();
            ItemCompositeDts[] entityItemCompositeDts = GetItemCompositeDts();
            //ItemLBDts[] entityItemLBDts = GetItemLBDts();
            //ItemColorDts[] entityItemColorDts = GetItemColorDts();
            rule.RAdd(entity, entityItemCompositeDts);
            return(entity.ID);
        }
Пример #4
0
        //public bool CheckCorrectItemDts()
        //{
        //    decimal Percentage = 0;
        //    int Num = 0;
        //    for (int i = 0; i < gridView2.RowCount; i++)
        //    {
        //        if (SysConvert.ToString(gridView2.GetRowCellValue(i, "DtsItemCode")) != string.Empty)
        //        {
        //            Percentage += SysConvert.ToDecimal(gridView2.GetRowCellValue(i, "Percentage"));
        //            Num++;
        //        }
        //    }
        //    if (Num > 0)
        //    {
        //        if (Percentage != 100 && Percentage != 200)
        //        {
        //            return false;
        //        }
        //    }
        //    return true;
        //}

        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            ItemGB[]             entityItemGB       = GetItemGB();
            ItemDts[]            entityItemDts      = GetItemDts();
            ItemLBDts[]          entityItemLBDts    = GetItemLBDts();
            ItemColorDts[]       entityItemColorDts = GetItemColorDts();
            ItemGreyFabReplace[] entitygfr          = GetEntityGreyFabReplace();
            rule.RAdd(entity, entityItemDts, entityItemColorDts, entityItemLBDts, null, entitygfr);
            return(entity.ID);
        }
Пример #5
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            ItemGB[]         entityItemGB       = GetItemGB();
            ItemDts[]        entityItemDts      = GetItemDts();
            ItemLBDts[]      entityItemLBDts    = GetItemLBDts();
            ItemColorDts[]   entityItemColorDts = GetItemColorDts();
            ItemCodeFacDts[] entityItemFacDts   = GetItemCodeFacDts();
            rule.RAdd(entity, entityItemDts, entityItemColorDts, entityItemLBDts, null, null, entityItemFacDts);
            return(entity.ID);
        }
Пример #6
0
        //public bool CheckCorrectItemDts()
        //{
        //    decimal Percentage = 0;
        //    int Num = 0;
        //    for (int i = 0; i < gridView2.RowCount; i++)
        //    {
        //        if (SysConvert.ToString(gridView2.GetRowCellValue(i, "DtsItemCode")) != string.Empty)
        //        {
        //            Percentage += SysConvert.ToDecimal(gridView2.GetRowCellValue(i, "Percentage"));
        //            Num++;
        //        }
        //    }
        //    if (Num > 0)
        //    {
        //        if (Percentage != 100 && Percentage != 200)
        //        {
        //            return false;
        //        }
        //    }
        //    return true;
        //}

        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            ItemGB[]               entityItemGB       = GetItemGB();
            ItemDts[]              entityItemDts      = GetItemDts();
            ItemLBDts[]            entityItemLBDts    = GetItemLBDts();
            ItemColorDts[]         entityItemColorDts = GetItemColorDts();
            ItemCheckStandardPhy[] entitycspdts       = GetItemCheckStandardPhy();
            rule.RAdd(entity, entityItemDts, entityItemColorDts, entityItemLBDts, entitycspdts);
            return(entity.ID);
        }
Пример #7
0
        //public bool CheckCorrectItemDts()
        //{
        //    decimal Percentage = 0;
        //    int Num = 0;
        //    for (int i = 0; i < gridView2.RowCount; i++)
        //    {
        //        if (SysConvert.ToString(gridView2.GetRowCellValue(i, "DtsItemCode")) != string.Empty)
        //        {
        //            Percentage += SysConvert.ToDecimal(gridView2.GetRowCellValue(i, "Percentage"));
        //            Num++;
        //        }
        //    }
        //    if (Num > 0)
        //    {
        //        if (Percentage != 100 && Percentage != 200)
        //        {
        //            return false;
        //        }
        //    }
        //    return true;
        //}

        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            //ItemGB[] entityItemGB = GetItemGB();
            //ItemDts[] entityItemDts = GetItemDts();
            //ItemLBDts[] entityItemLBDts = GetItemLBDts();
            ItemColorDts[] entityItemColorDts = GetItemColorDts();
            //ItemGreyFabReplace[] entitygfr = GetEntityGreyFabReplace();
            ItemAdd[]        entityItemAdd    = GetItemAdd();
            ItemPic[]        entityPic        = GetItemPic();
            ItemCodeFacDts[] entityItemFacDts = GetItemCodeFacDts();
            rule.RAdd(entity, entityItemColorDts, entityItemAdd, entityPic, entityItemFacDts, 1);
            return(entity.ID);
        }
Пример #8
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            ItemRule rule   = new ItemRule();
            Item     entity = GetItem();

            ItemGB[]         entityItemGB       = GetItemGB();
            ItemDts[]        entityItemDts      = GetItemDts();
            ItemLBDts[]      entityItemLBDts    = GetItemLBDts();
            ItemColorDts[]   entityItemColorDts = GetItemColorDts();
            ItemCodeFacDts[] entityItemFacDts   = GetItemCodeFacDts();

            if (entityItemFacDts.Length != 0)//主供应商信息
            {
                entity.VendorID = entityItemFacDts[0].VendorID;
            }

            rule.RAdd(entity, entityItemDts, entityItemColorDts, entityItemLBDts, null, null, entityItemFacDts);
            return(entity.ID);
        }