Beispiel #1
0
        private void AssistSupply()
        {
            try
            {
                this.gGrid1.FinishEditing();
                List <SM_BOMTEMP> tempdata = (this.gGrid1.DataSource as BindingList <SM_BOMTEMP>).ToList <SM_BOMTEMP>();

                var updata = from temp in tempdata
                             where temp.ISSELECT == true
                             select temp;

                SM_ASSISTMSUPPLY asupply = new SM_ASSISTMSUPPLY();
                asupply.ASSISTMSUPPLYDTL.Clear();
                asupply.ORDERID      = saleorder.ORDERID;
                asupply.ACUSTID      = saleorder.CUSTID;
                asupply.SALESMANNAME = saleorder.SALESMANNAME;
                asupply.SALESREPNAME = saleorder.SALESREPNAME;
                foreach (SM_BOMTEMP t in updata)
                {
                    SM_ASSISTMSUPPLYDTL dtl = new SM_ASSISTMSUPPLYDTL();
                    dtl.ITEMCODE       = t.ITEMCODE;
                    dtl.ITEMNAME       = t.ITEMNAME;
                    dtl.UNIT           = t.INVUNIT;
                    dtl.ATTRIBUTEA     = t.ATTRIBUTEA;
                    dtl.ATTRIBUTEB     = t.ATTRIBUTEB;
                    dtl.ATTRIBUTEBNAME = t.ATTRIBUTEBNAME;
                    dtl.ATTRIBUTEC     = t.ATTRIBUTEC;
                    dtl.ATTRIBUTED     = t.ATTRIBUTED;
                    dtl.PLANQTY        = t.UNASSISTQTY;
                    dtl.FACTQTY        = t.UNASSISTQTY;
                    dtl.BOMTEMPID      = t.Id;
                    dtl.NEEDING        = t.MEMO;
                    asupply.ASSISTMSUPPLYDTL.Add(dtl);
                }

                Assist.SM_ASSISTMSUPPLYEDIT asistEdit = new Assist.SM_ASSISTMSUPPLYEDIT();
                asistEdit.CurEditStatus = EditorStatus.Modify;
                asistEdit.SetData(asupply);
                asistEdit.ShowDialog();

                foreach (SM_BOMTEMP t in updata)
                {
                    if (t.UNASSISTQTY <= t.ONHANDQTY)
                    {
                        t.ASSISTQTY = G.Core.GConvert.ToDecimal(t.ASSISTQTY) + t.UNASSISTQTY;
                    }
                    else
                    {
                        t.ASSISTQTY = G.Core.GConvert.ToDecimal(t.ASSISTQTY) + t.ONHANDQTY;
                    }
                    ((SM_BOMTEMPLogic)this.Logic).ExecuteUpdate(G.AppInfo.GGlobal.User, tempdata);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Beispiel #2
0
 public override void AddRow()
 {
     SM_ASSISTMSUPPLYDTL assistmsupplydtl = gGrid1.AddRow <SM_ASSISTMSUPPLYDTL>();
 }