public OrdersManage() { InitializeComponent(); removeTextInit = this.label5.Text; this.dataGridView1.DataSource = OrderDAO.SelectOrderUserFromOrder(); resetComboBox1(); resetComboBox2(); resetComboBox3(); }
private void button1_Click(object sender, EventArgs e) { if (this.comboBox1.SelectedIndex != -1 && this.comboBox2.SelectedIndex != -1) { OrderDAO.AddNew(productos[this.comboBox2.SelectedIndex].id + ", " + addreses[this.comboBox1.SelectedIndex].id); this.dataGridView1.DataSource = OrderDAO.SelectOrderUserFromOrder(); resetComboBox1(); resetComboBox2(); resetComboBox3(); } else { MessageBox.Show("Selecciona todas las opciones"); } }
private void button2_Click(object sender, EventArgs e) { int num = this.comboBox3.SelectedIndex; if (num != -1) { OrderDAO.RemoveOrder(orders[num].id); this.dataGridView1.DataSource = OrderDAO.SelectOrderUserFromOrder(); resetComboBox1(); resetComboBox2(); resetComboBox3(); } else { MessageBox.Show("Selecciona una opcion antes de eliminar"); } }