private void actualizarControlesAdmin() { List <AppUser> listau = AppUserDao.getListaUsu(); cmbEliminarUsu.DataSource = null; cmbEliminarUsu.DisplayMember = "iduser"; cmbEliminarUsu.DataSource = listau; dgvVerUsuarios.DataSource = listau; List <Business> listab = BusinessDAO.getListaBusiness(); cmbEliminarNegocio.DataSource = null; cmbEliminarNegocio.DisplayMember = "idbusiness"; cmbEliminarNegocio.DataSource = listab; dataGridView1.DataSource = listab; cmbAddProduct.DataSource = null; cmbAddProduct.DisplayMember = "idbusiness"; cmbAddProduct.DataSource = listab; List <Product> listap = ProductDAO.GetListaProducts(); combEliminarProd.DataSource = null; combEliminarProd.DisplayMember = "idproduct"; combEliminarProd.DataSource = listap; dgvVerProductos.DataSource = listap; List <AppOrder> listao = AppOrderDAO.getListaOrders(); dgvVerOrdenes.DataSource = listao; }
private void btnDelNewOrder_Click(object sender, EventArgs e) { try { AppOrderDAO.EliminarOrder(Convert.ToInt32(txtDelOrderID.Text)); MessageBox.Show("Eliminado con exito", "Hugo App", MessageBoxButtons.OK, MessageBoxIcon.Information); ActualizarControles(); } catch (Exception exception) { MessageBox.Show("La orden no existe.", "Hugo App", MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } }
private void button2_Click(object sender, EventArgs e) { try { AppOrderDAO.CrearNuevo(Convert.ToInt32(txtNewOrderIDNeg.Text), Convert.ToInt32(txtNewOrderNombre.Text)); MessageBox.Show("Ingresado con exito", "Hugo App", MessageBoxButtons.OK, MessageBoxIcon.Information); ActualizarControles(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Hugo App", MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } }
private void btnEliminarOrden_Click(object sender, EventArgs e) { try { if (textBox1.Text.Length > 0) { AppOrderDAO.eliminarOrden(Convert.ToInt32(textBox1.Text)); MessageBox.Show("¡Orden eliminada exitosamente!.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControlesUsu(); } else { MessageBox.Show("Favor digite un id ", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception) { MessageBox.Show("EL id no se encuentra disponible.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAgregarOrden_Click(object sender, EventArgs e) { try { if (txtAgregarOrden.Text.Length > 0 && cmbAgregarProd.Text.Length > 0) { AppOrderDAO.insertarOrden(DateTime.Now, Convert.ToInt32(cmbAgregarProd.Text), Convert.ToInt32(txtAgregarOrden.Text)); MessageBox.Show("¡Orden agregada exitosamente!.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Information); actualizarControlesUsu(); } else { MessageBox.Show("Favor digite un id ", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception) { MessageBox.Show("EL id no se encuentra disponible.", "SourceCode", MessageBoxButtons.OK, MessageBoxIcon.Error); } }