Ejemplo n.º 1
0
        public void AddReturnItem()
        {
            if (CurrentReturnHeader != null)
            {
                _goodsReturnAddModel.IsEdit = false;
                //_goodsReturnAddModel.IsChanged = false;
                using (var dlg = new GoodsReturnAddDlg(_goodsReturnAddModel))
                {
                    var rf = new Refresh(_goodsReturnAddModel.RefreshInvoiceData);
                    rf();

                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            CurrentReturnHeader.AddNewItem(_goodsReturnAddModel.GetReturnItemObj());
                            _goodsReturnAddModel.GetInvoiceData().Refresh(_goodsReturnAddModel.GetReturnItemObj().InvoiceDataId);
                            _goodsReturnAddModel.IsChanged = true;
                        }
                        catch (Exception e)
                        {
                            XtraMessageBox.Show(e.Message, "Создание позиции возврата");
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void EditReturnItem(ReturnItemObj item)
 {
     if ((CurrentReturnHeader != null) && (item != null))
     {
         _goodsReturnAddModel.EditReturnItemObj(item);
         using (var dlg = new GoodsReturnAddDlg(_goodsReturnAddModel))
         {
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 CurrentReturnHeader.EditItem(item.Id, _goodsReturnAddModel.GetReturnItemObj());
                 _goodsReturnAddModel.GetInvoiceData().Refresh(_goodsReturnAddModel.GetReturnItemObj().InvoiceDataId);
                 _goodsReturnAddModel.EdititItem = null;
             }
         }
     }
 }