private void buttonOrderNew_Click(object sender, EventArgs e) { Order theOrder = new Order(); theOrder.Manufacturer = Manufacturer.GetAll()[0]; theOrder.OrderStatus = OrderStatus.GetAll()[0]; theOrder.Save(); FormOrderNew theFormOrderNew = new FormOrderNew(theOrder); theFormOrderNew.ShowDialog(); LoadOrders(); }
private void LoadManufacturer() { try { this.comboBoxManufacturer.DisplayMember = "Name"; this.comboBoxManufacturer.ValueMember = "ID"; this.comboBoxManufacturer.DataSource = Manufacturer.GetAll(); } catch (Exception ex) { this.comboBoxManufacturer.DataSource = null; this.comboBoxManufacturer.Items.Add(ex.Message); } }
private void buttonOrderEdit_Click(object sender, EventArgs e) { try { Order theOrder = this.listBoxOrders.SelectedItem as Order; if (theOrder == null) { return; } theOrder.Manufacturer = Manufacturer.GetAll()[0]; theOrder.OrderStatus = OrderStatus.GetAll()[0]; FormOrderNew theFormOrderNew = new FormOrderNew(theOrder); theFormOrderNew.ShowDialog(); LoadOrders(); } catch (Exception ex) { this.listBoxOrders.DataSource = null; this.listBoxOrders.Items.Add(ex.Message); } }