private void btnModificar_Click(object sender, EventArgs e) { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); Insumos insumos = new Insumos(); string cadena = Text; try { insumos.Id = Convert.ToInt32(lblId.Text); insumos.Descripcion = txtDescripcion.Text; insumos.Disponibles = Convert.ToInt32(txtDisponibles.Text); insumos.Pu = Convert.ToDecimal(txtPu.Text); insumoAccionBusiness.eliminar(insumos.Id, cadena); insumoAccionBusiness.agregar(insumos, Text); MessageBox.Show(Text + " agregado correctamente"); txtPu.Clear(); txtDisponibles.Clear(); txtDescripcion.Clear(); dgvInsumos.DataSource = insumoAccionBusiness.leer(cadena); } catch (Exception ex) { throw ex; } }
public InsumosListar(string v) { InitializeComponent(); Text = v; InsumoBusiness listarInsumosBusiness = new InsumoBusiness(); dgvListar.DataSource = listarInsumosBusiness.leer(v); dgvListar.Columns["Id"].Visible = false; dgvListar.Columns["fecha"].Visible = false; dgvListar.Columns["Pu"].HeaderText = "Precio Unitario"; }
private void InsumoAccion_Load(object sender, EventArgs e) { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); try { string cadena = Text; dgvInsumos.DataSource = insumoAccionBusiness.leer(cadena); dgvInsumos.Columns["Id"].Visible = false; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void cargarMesa() { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); MesaBusiness mesaBusiness = new MesaBusiness(); cmbEntrada.DataSource = insumoAccionBusiness.leer("entrada"); cmbComida.DataSource = insumoAccionBusiness.leer("comida"); cmbBebida.DataSource = insumoAccionBusiness.leer("bebida"); cmbPostre.DataSource = insumoAccionBusiness.leer("postre"); cmbOtro.DataSource = insumoAccionBusiness.leer("otros"); cmbEntradas.DataSource = insumoAccionBusiness.leerCargado("entrada", Convert.ToInt32(lblNroPedido.Text)); cmbBebidas.DataSource = insumoAccionBusiness.leerCargado("bebida", Convert.ToInt32(lblNroPedido.Text)); cmbComidas.DataSource = insumoAccionBusiness.leerCargado("comida", Convert.ToInt32(lblNroPedido.Text)); cmbPostres.DataSource = insumoAccionBusiness.leerCargado("postre", Convert.ToInt32(lblNroPedido.Text)); cmbOtros.DataSource = insumoAccionBusiness.leerCargado("otro", Convert.ToInt32(lblNroPedido.Text)); Insumos insumosEntrada = (Insumos)cmbEntrada.SelectedItem; Insumos insumosEntradas = (Insumos)cmbEntradas.SelectedItem; Insumos insumosComida = (Insumos)cmbComida.SelectedItem; Insumos insumosComidas = (Insumos)cmbComidas.SelectedItem; Insumos insumosBebida = (Insumos)cmbBebida.SelectedItem; Insumos insumosBebidas = (Insumos)cmbBebidas.SelectedItem; Insumos insumosPostre = (Insumos)cmbPostre.SelectedItem; Insumos insumosPostres = (Insumos)cmbPostres.SelectedItem; Insumos insumosOtro = (Insumos)cmbOtro.SelectedItem; Insumos insumosOtros = (Insumos)cmbOtros.SelectedItem; lblDispEntrada.Text = insumosEntrada.Disponibles.ToString(); lblDispComida.Text = insumosComida.Disponibles.ToString(); lblDispBebida.Text = insumosBebida.Disponibles.ToString(); lblDispPostre.Text = insumosPostre.Disponibles.ToString(); lblDispOtros.Text = insumosOtro.Disponibles.ToString(); if (cmbEntradas.Items.Count == 0) { lblPUEntrada.Text = "0"; lblTotalEntrada.Text = "0"; } else { lblPUEntrada.Text = insumosEntradas.Pu.ToString(); //Convert.ToString(Convert.ToDecimal(insumosEntradas.Pu)); } if (cmbBebidas.Items.Count == 0) { lblPUBebida.Text = "0"; lblTotalBebida.Text = "0"; } else { lblPUBebida.Text = insumosBebida.Pu.ToString(); } if (cmbComidas.Items.Count == 0) { lblPUComida.Text = "0"; lblTotalComida.Text = "0"; } else { lblPUComida.Text = insumosComida.Pu.ToString(); } if (cmbPostres.Items.Count == 0) { lblPUPostre.Text = "0"; lblTotalPostre.Text = "0"; } else { lblPUPostre.Text = insumosPostre.Pu.ToString(); } if (cmbOtros.Items.Count == 0) { lblPUOtros.Text = "0"; lblTotalOtros.Text = "0"; } else { lblPUOtros.Text = insumosOtros.Pu.ToString(); } lblTotalBebida.Text = Convert.ToString(calcularTotalBebida()); lblTotalComida.Text = Convert.ToString(calcularTotalComida()); lblTotalEntrada.Text = Convert.ToString(calcularTotalEntrada()); lblTotalOtros.Text = Convert.ToString(calcularTotalOtro()); lblTotalPostre.Text = Convert.ToString(calcularTotalPostre()); lblTotal.Text = Convert.ToString(calcularTotales()); }