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); } }
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>(); }
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(); }
private void SearchReturnedHistory() { ReturnedHistoryService service = new ReturnedHistoryService(_context); SearchParam p = new SearchParam(); p.CurrentPage = _returnCurrentPage - 1; p.PageSize = _pageSize; p.DRNumber = txtReturnedDr.Text; p.OrderBy = rbReturnedAscending.Checked ? OrdeBy.Ascending : OrdeBy.Descending; ReturnItemResult r = service.SearchReturnedHistories(p); _returnedHistories = r.Results; LoadToReturnHistoryListView(); _returnPageCount = r.PageCount; SetNavigationText(); }
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(); }
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(); }