public void ShowOrderEditForm() { try { Zamówienie order = orders.GetActiveElement(); OrderForm form = new OrderForm(order); OrderFormController formController = new OrderFormController(form, Operation.Edit); formController.Queries = queriesOrder; dr = form.ShowDialog(); ReloadIfFormReturnedOK(); } catch (NullReferenceException ex) { } }
public void ShowOrderDeleteForm() { try { Zamówienie order = orders.GetActiveElement(); OrderForm form = new OrderForm(order); OrderFormController formController = new OrderFormController(form, Operation.Delete); formController.Queries = queriesOrder; form.ShowDialog(); SelectAllAtActiveWindow(); } catch (NullReferenceException ex) { } }
// --- FORMULARZE public void ShowOrderAddForm() { OrderForm form = new OrderForm(); OrderFormController formController = new OrderFormController(form, Operation.Add); formController.Queries = queriesOrder; dr = form.ShowDialog(); ReloadIfFormReturnedOK(); }
public void ShowOrderEditForm() { try { Zamówienie order = orders.GetActiveElement(); OrderForm form = new OrderForm(order); OrderFormController formController = new OrderFormController(form, Operation.Edit); formController.OrderQuery = queriesOrder; formController.WarehouseQuery = queriesWarehouse; form.PartsNotAddedToOrder = queriesOrder.SelectPartsAvailableToOrder(); form.PartsAddedToOrder = queriesOrder.SelectPartsByOrder((int)order.Zamówienie_ID); form.SetColumns(); dr = form.ShowDialog(); ReloadIfFormReturnedOK(); } catch (NullReferenceException) { } }
public void ShowOrderDeleteForm() { if (MessageBox.Show("Czy chcesz usunąć zamówienie?", "Wypożyczalnia", MessageBoxButtons.YesNo) == DialogResult.Yes) { Zamówienie order = orders.GetActiveElement(); OrderForm form = new OrderForm(order); OrderFormController formController = new OrderFormController(form, Operation.Delete); formController.OrderQuery = queriesOrder; formController.WarehouseQuery = queriesWarehouse; formController.Delete(); dr = DialogResult.OK; ReloadIfFormReturnedOK(); } }
// --- FORMULARZE public void ShowOrderAddForm() { OrderForm form = new OrderForm(); OrderFormController formController = new OrderFormController(form, Operation.Add); formController.OrderQuery = queriesOrder; formController.WarehouseQuery = queriesWarehouse; form.PartsNotAddedToOrder = queriesOrder.SelectPartsAvailableToOrder(); form.PartsAddedToOrder = form.PartsNotAddedToOrder.Clone(); form.SetColumns(); dr = form.ShowDialog(); ReloadIfFormReturnedOK(); }