Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }