コード例 #1
0
 public WMSPackingEditForm(WMS_M104_Packing_Hd packHd, IWMS_M104_Packing_HdService packingService)
 {
     InitializeComponent();
     this.tempData = packHd;
     this.DateDateEdit.Focus();
     this.packingService = packingService;
 }
コード例 #2
0
        public void Create(WMS_M104_Packing_Hd WMS_M104_Packing_Hd)
        {
            WMS_M104_Packing_Hd.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_M104_Packing_Hd.CreateUser = tempUser.UserName;
            WMS_M104_Packing_Hd.Validate();
            this.WMS_M104_Packing_HdRepository.Add(WMS_M104_Packing_Hd);
            this.runtimeService.Commit();
        }
コード例 #3
0
        public void Update(WMS_M104_Packing_Hd WMS_M104_Packing_Hd)
        {
            WMS_M104_Packing_Hd.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_M104_Packing_Hd.ModifyUser = tempUser.UserName;
            WMS_M104_Packing_Hd.Validate();
            var existstb_Sys_Menu = this.GetById(WMS_M104_Packing_Hd.Id);

            this.WMS_M104_Packing_HdRepository.SetValues(WMS_M104_Packing_Hd, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
コード例 #4
0
        void wMSM104PackingHdBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            WMS_M104_Packing_Hd tempData = this.wMSM104PackingHdBindingSource.Current as WMS_M104_Packing_Hd;

            if (tempData != null)
            {
                this.wMSM104PackingDetailBindingSource.DataSource = packingService.GetDetailList(tempData.Id);
            }
            else
            {
                this.wMSM104PackingDetailBindingSource.DataSource = null;
            }
        }
コード例 #5
0
        private void OpenForm(string formText, string btnCommand)
        {
            WMS_M104_Packing_Hd temp = this.wMSM104PackingHdBindingSource.Current as WMS_M104_Packing_Hd;
            WMSPackingEditForm  edit = new WMSPackingEditForm(temp, packingService);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                this.wMSM104PackingHdBindingSource.CancelEdit();
            }
            else
            {
                wMSM104PackingHdBindingSource_CurrentChanged(null, null);
            }
        }
コード例 #6
0
        public void Save(WMS_M104_Packing_Hd instore, List <WMS_M104_Packing_Detail> instoreDetailList)
        {
            //if (instore.BeforeAmount < instore.ActualAmount)
            //    throw new AppException("实际入库数不能大于计划入库数");
            tb_Sys_User tempUser    = appCacheService.GetItem("user") as tb_Sys_User;
            var         existslotTx = this.GetById(instore.Id);

            if (existslotTx == null)
            {
                instore.CreateDt   = DateTime.Now;
                instore.CreateUser = tempUser.UserName;
                instore.Validate();
                this.WMS_M104_Packing_HdRepository.Add(instore);
            }
            else
            {
                instore.ModifyDt   = DateTime.Now;
                instore.ModifyUser = tempUser.UserName;
                instore.Validate();
                this.WMS_M104_Packing_HdRepository.SetValues(instore, existslotTx);
            }
            if (instoreDetailList != null)
            {
                foreach (var detail in instoreDetailList)
                {
                    var existstLotTxNG = this.packingDetailRepository.GetByID(detail.Id);
                    if (existstLotTxNG == null)
                    {
                        detail.Validate();
                        this.packingDetailRepository.Add(detail);
                    }
                    else
                    {
                        this.packingDetailRepository.SetValues(detail, existstLotTxNG);
                    }
                }
            }
            this.runtimeService.Commit();
        }
コード例 #7
0
 public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     // MessageBox.Show(e.Item.Caption);
     //新增
     if (e.Item.Caption == BtnCommandEnum.Add)
     {
         this.wMSM104PackingHdBindingSource.AddNew();
         WMS_M104_Packing_Hd temp = this.wMSM104PackingHdBindingSource.Current as WMS_M104_Packing_Hd;
         temp.Code = "NINGBO KANGQIANG ELECTRONICS CO.,LTD";
         OpenForm("装箱单新增", BtnCommandEnum.Add);
     }
     else if (e.Item.Caption == BtnCommandEnum.Edit)
     {
         OpenForm("装箱单修改", BtnCommandEnum.Edit);
     }
     else if (e.Item.Caption == BtnCommandEnum.Delete)
     {
         if (ERPHelper.Instance.MessageDel())
         {
             WMS_M104_Packing_Hd tempData = this.wMSM104PackingHdBindingSource.Current as WMS_M104_Packing_Hd;
             packingService.Delete(tempData.Id);
             this.wMSM104PackingHdBindingSource.RemoveCurrent();
         }
     }
     else if (e.Item.Caption == BtnCommandEnum.Print)
     {
         WMS_M104_Packing_Hd temp = this.wMSM104PackingHdBindingSource.Current as WMS_M104_Packing_Hd;
         if (temp == null)
         {
             throw new AppException("请先选择数据");
         }
         PackingListReport reportFrm     = new PackingListReport(temp.Id);
         ReportShowForm    reportShowFrm = new ReportShowForm(reportFrm);
         reportShowFrm.Text = "装箱单-" + temp.CustCode;
         reportShowFrm.ShowDialog();
     }
 }