예제 #1
0
        private void ShowInOut(InOrOut inOrOut)
        {
            if (listViewItem.SelectedItems.Count >= 1)
            {
                ItemService            itemService            = new ItemService(_context);
                DRService              drService              = new DRService(_context);
                HistoryService         historyService         = new HistoryService(_context);
                ReturnedHistoryService returnedHistoryService = new ReturnedHistoryService(_context);

                InOutService inOutService = new InOutService(itemService, historyService
                                                             , drService, returnedHistoryService);

                long itemId       = Convert.ToInt64(listViewItem.SelectedItems[0].SubItems[0].Text);
                Item selectedItem = _items.FirstOrDefault(i => i.Id == itemId);

                InOutWithOutDRForm f = new InOutWithOutDRForm(itemService, inOutService,
                                                              inOrOut, selectedItem, _name);

                f.ShowDialog();
                if (f.HaveChangedQuantity)
                {
                    SearchItem();
                }
            }
            else
            {
                MessageBox.Show("Please select Item from the list", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #2
0
 public ReturnedItemForm(ReturnedHistory history, ReturnedHistoryService returnedHistoryService,
                         InOutService inOutService, DRService drService, string name)
 {
     _history = history;
     _returnedHistoryService = returnedHistoryService;
     _inOutService           = inOutService;
     _drService = drService;
     _name      = name;
     InitializeComponent();
     _goodItems  = new List <ReturnedItem>();
     _scrapItems = new List <ScrapItem>();
 }
예제 #3
0
        private void cmdCreateReturn_Click(object sender, EventArgs e)
        {
            ItemService            itemService            = new ItemService(_context);
            HistoryService         historyService         = new HistoryService(_context);
            ReturnedHistoryService returnedHistoryService = new ReturnedHistoryService(_context);
            DRService drService = new DRService(_context);

            InOutService inOutService = new InOutService(itemService, historyService,
                                                         drService, returnedHistoryService);

            ReturnedItemForm f = new ReturnedItemForm(null, returnedHistoryService
                                                      , inOutService, drService, _name);

            f.ShowDialog();
        }
예제 #4
0
        public InWithDRForm(ItemService itemService, SupplierService supplierService,
                            CustomerService customerService, DRService drService, InOutService inOutService,
                            DRParam param, string name)
        {
            _itemService     = itemService;
            _supplierService = supplierService;
            _customerService = customerService;
            _drService       = drService;
            _inOutService    = inOutService;
            _param           = param;
            _name            = name;

            _items   = _itemService.AllActiveItems();
            _drItems = new List <DRItem>();

            InitializeComponent();
        }
예제 #5
0
        private void SearchDR()
        {
            DRService service = new DRService(_context);

            SearchParam p = new SearchParam();

            p.CurrentPage = _drCurrentPage - 1;
            p.PageSize    = _pageSize;

            p.ReceiptType = (ReceiptType)cboCategory.SelectedItem;
            p.DRNumber    = txtDrNumber.Text;
            p.OrderBy     = rbDRAscending.Checked ? OrdeBy.Ascending : OrdeBy.Descending;

            DRSearchResult r = service.DRSearch(p);

            _Drs = r.Results;
            LoadDRToListView();
            _drPageCount = r.PageCount;

            SetNavigationText();
        }
예제 #6
0
        private void cmdEditReturn_Click(object sender, EventArgs e)
        {
            if (listViewReturn.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select History from the list", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            long                   returnId               = Convert.ToInt64(listViewReturn.SelectedItems[0].SubItems[0].Text);
            ItemService            itemService            = new ItemService(_context);
            HistoryService         historyService         = new HistoryService(_context);
            ReturnedHistoryService returnedHistoryService = new ReturnedHistoryService(_context);
            DRService              drService              = new DRService(_context);

            InOutService inOutService = new InOutService(itemService, historyService,
                                                         drService, returnedHistoryService);

            ReturnedHistory  h = returnedHistoryService.GetHistory(returnId);
            ReturnedItemForm f = new ReturnedItemForm(h, returnedHistoryService,
                                                      inOutService, drService, _name);

            f.ShowDialog();
        }
예제 #7
0
        private void loadSDRForm(ReceiptType type, Operation operation,
                                 SupplierOrCustomer sc, DR selectedSDR)
        {
            ItemService            itemService            = new ItemService(_context);
            HistoryService         historyService         = new HistoryService(_context);
            SupplierService        supplierService        = new SupplierService(_context);
            CustomerService        customerService        = new CustomerService(_context);
            DRService              drService              = new DRService(_context);
            ReturnedHistoryService returnedHistoryService = new ReturnedHistoryService(_context);
            InOutService           inOutService           = new InOutService(itemService, historyService,
                                                                             drService, returnedHistoryService);

            DRParam p = new DRParam();

            p.ReceiptType = type;
            p.Operation   = operation;
            p.SC          = sc;
            p.SelectedDR  = selectedSDR;

            InWithDRForm f = new InWithDRForm(itemService, supplierService, customerService,
                                              drService, inOutService, p, _name);

            f.ShowDialog();
        }
예제 #8
0
 public DRBrowserForm(DRService drService)
 {
     _drService = drService;
     InitializeComponent();
     _drs = new List <DR>();
 }