Пример #1
0
 private void PrepurOrder()
 {
     try
     {
         SM_BOMTEMP temp = new SM_BOMTEMP();
         G.BLL.ERP.BaseData.DM_ITEMLogic itemlogic = new G.BLL.ERP.BaseData.DM_ITEMLogic();
         SM_PREPURORDER prepur = new SM_PREPURORDER();
         if (tabControl1.SelectedIndex == 0)
         {
             this.Grid_CP.FinishEditing();
             temp = this.Grid_CP.GetCurSelect <SM_BOMTEMP>();
         }
         else
         {
             this.Grid_ZJ.FinishEditing();
             temp = this.Grid_ZJ.GetCurSelect <SM_BOMTEMP>();
         }
         prepur.PREPURQTY      = G.Core.GConvert.ToDecimal(temp.LEFTQTY);
         prepur.ORDERID        = temp.ORDERID;
         prepur.ORDLNNO        = temp.ORDLNNO;
         prepur.APPLYUSER      = G.AppInfo.GGlobal.User.USERDM;
         prepur.APPLYUSERNAME  = G.AppInfo.GGlobal.User.USERNAME;
         prepur.ITEMCODE       = temp.ITEMCODE;
         prepur.ITEMNAME       = temp.ITEMNAME;
         prepur.PURTYPE        = "1";
         prepur.INVUNIT        = temp.INVUNIT;
         prepur.BOMTEMPID      = temp.Id;
         prepur.ATTRIBUTEA     = temp.ATTRIBUTEA;
         prepur.ATTRIBUTEB     = temp.ATTRIBUTEB;
         prepur.ATTRIBUTEBNAME = temp.ATTRIBUTEBNAME;
         prepur.ATTRIBUTEC     = temp.ATTRIBUTEC;
         prepur.ATTRIBUTED     = temp.ATTRIBUTED;
         prepur.REMARK         = temp.MEMO;
         DM_ITEM itemobj = itemlogic.ExecuteSelect(CK.K["ITEMCODE"].Eq(temp.ITEMCODE), OrderBy.Parse("ITEMCODE"), 0, 0)[0];
         prepur.SUPCODE      = itemobj.SUPCODE;
         prepur.SUPPRICE     = itemobj.SUPPRICE;
         prepur.ISATTRIBUTEA = G.Core.GConvert.ToBool(itemobj.IsAttributeA);
         prepur.ISATTRIBUTEB = G.Core.GConvert.ToBool(itemobj.IsAttributeB);
         prepur.ISATTRIBUTEC = G.Core.GConvert.ToBool(itemobj.IsAttributeC);
         //弹出采购申请单,数据来自选择行
         Purchase.SM_PREPURORDEREDIT prepurEdit = new Purchase.SM_PREPURORDEREDIT();
         prepurEdit.SetData(prepur);
         DialogResult drst = prepurEdit.ShowDialog();
         if (drst == DialogResult.OK)
         {
             //采购数量填入BOMTEMP
             temp.PURQTY += temp.LEFTQTY;
             ((SM_BOMTEMPLogic)this.Logic).ExecuteUpdate(G.AppInfo.GGlobal.User, temp);
         }
         this.LoadGridCP(orderid, gxname);
         this.LoadGridShop(orderid, gxname);
         this.LoadGridZJ(orderid, gxname);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
Пример #2
0
        private void AssistMsupply()
        {
            try
            {
                SM_BOMTEMP temp = new SM_BOMTEMP();
                G.BLL.ERP.BaseData.DM_ITEMLogic itemlogic = new G.BLL.ERP.BaseData.DM_ITEMLogic();
                SM_SHOPSUPPLY shopsupply = new SM_SHOPSUPPLY();
                shopsupply.APPLYER     = G.AppInfo.GGlobal.User.USERDM;
                shopsupply.APPLYERNAME = G.AppInfo.GGlobal.User.USERNAME;
                shopsupply.APPLYDATE   = DateTime.Parse(BaseExtends.GetServerDate().ToShortDateString());
                G.BLL.Sys.ND_ORGINAZITIONLogic userlogic = new BLL.Sys.ND_ORGINAZITIONLogic();
                ND_ORGINAZITION userobj = userlogic.ExecuteSelect(CK.K["ID"].Eq(G.AppInfo.GGlobal.User.ORGID), OrderBy.Parse("ORGNAME"), 0, 0)[0];
                shopsupply.WORKSHOP = userobj.ORGDM;
                shopsupply.ORGNAME  = userobj.ORGNAME;

                SM_SHOPSUPPLYDTL dtl = new SM_SHOPSUPPLYDTL();
                if (tabControl1.SelectedIndex == 0)
                {
                    this.Grid_CP.FinishEditing();
                    temp       = this.Grid_CP.GetCurSelect <SM_BOMTEMP>();
                    dtl.ACTQTY = G.Core.GConvert.ToDecimal(temp.LEFTQTY);
                }
                else
                {
                    this.Grid_ZJ.FinishEditing();
                    temp = this.Grid_ZJ.GetCurSelect <SM_BOMTEMP>();
                    DM_ITEM itemobj1 = itemlogic.ExecuteSelect(CK.K["ITEMCODE"].Eq(temp.FATHERITEM), OrderBy.Parse("ITEMCODE"), 0, 0)[0];
                    if (temp.FATHERITEM.Substring(0, 4) == "S1LS")
                    {
                        dtl.ACTQTY = G.Core.GConvert.ToDecimal(temp.LEFTQTY * itemobj1.ISIZE / 100);
                    }
                    else
                    {
                        dtl.ACTQTY = G.Core.GConvert.ToDecimal(temp.LEFTQTY);
                    }
                }
                dtl.ITEMCODE       = temp.ITEMCODE;
                dtl.ITEMNAME       = temp.ITEMNAME;
                dtl.UNIT           = temp.INVUNIT;
                dtl.ATTRIBUTEA     = temp.ATTRIBUTEA;
                dtl.ATTRIBUTEB     = temp.ATTRIBUTEB;
                dtl.ATTRIBUTEBNAME = temp.ATTRIBUTEBNAME;
                dtl.ATTRIBUTEC     = temp.ATTRIBUTEC;
                dtl.ATTRIBUTED     = temp.ATTRIBUTED;
                dtl.MEMO           = temp.MEMO;
                dtl.BOMTEMPID      = temp.Id;
                DM_ITEM itemobj = itemlogic.ExecuteSelect(CK.K["ITEMCODE"].Eq(temp.ITEMCODE), OrderBy.Parse("ITEMCODE"), 0, 0)[0];
                dtl.ISATTRIBUTEA = G.Core.GConvert.ToBool(itemobj.IsAttributeA);
                dtl.ISATTRIBUTEB = G.Core.GConvert.ToBool(itemobj.IsAttributeB);
                dtl.ISATTRIBUTEC = G.Core.GConvert.ToBool(itemobj.IsAttributeC);

                shopsupply.SHOPSUPPLYDTL.Add(dtl);
                //弹出外协领料单,数据来自选择行
                Storage.SM_SHOPSUPPLYEDIT edit = new Storage.SM_SHOPSUPPLYEDIT();
                edit.CurEditStatus = EditorStatus.Modify;
                edit.SetData(shopsupply);
                edit.ShowDialog();

                this.LoadGridCP(orderid, gxname);
                this.LoadGridShop(orderid, gxname);
                this.LoadGridZJ(orderid, gxname);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }