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; } }
private void dgvInsumos_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Insumos insumos = (Insumos)dgvInsumos.CurrentRow.DataBoundItem; lblId.Text = insumos.Id.ToString(); txtDescripcion.Text = insumos.Descripcion; txtDisponibles.Text = insumos.Disponibles.ToString(); txtPu.Text = insumos.Pu.ToString(); btnModificar.Show(); btnAgregar.Hide(); }
public void cargarMesa() { InsumoAccionBusiness insumoAccionBusiness = new InsumoAccionBusiness(); 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"); Insumos insumosComida = (Insumos)cmbComida.SelectedItem; Insumos insumosBebida = (Insumos)cmbBebida.SelectedItem; Insumos insumosPostre = (Insumos)cmbPostre.SelectedItem; Insumos insumosOtro = (Insumos)cmbOtro.SelectedItem; }
private void txtBuscar_TextChanged(object sender, EventArgs e) { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); Insumos insumos = new Insumos(); string cadena = Text; string busqueda = txtBuscar.Text.Trim(); try { dgvInsumos.DataSource = insumoAccionBusiness.buscar(cadena, busqueda); } catch (Exception ex) { throw ex; } }
private void btnOKComida_Click(object sender, EventArgs e) { Insumos insumosComida = (Insumos)cmbComida.SelectedItem; if (insumosComida.Disponibles == 0) { MessageBox.Show("No hay comidas disponibles"); return; } else { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); insumoAccionBusiness.insumoSeleccionadoBtnOk(insumosComida, "comidas", Convert.ToInt32(lblNroPedido.Text)); cargarMesa(); } }
private void btnOKPostre_Click(object sender, EventArgs e) { Insumos insumosPostre = (Insumos)cmbPostre.SelectedItem; if (insumosPostre.Disponibles == 0) { MessageBox.Show("No hay postres disponibles"); return; } else { decimal i = insumosPostre.Pu; InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); insumoAccionBusiness.insumoSeleccionadoBtnOk(insumosPostre, "postres", Convert.ToInt32(lblNroPedido.Text)); cargarMesa(); } }
private void btnNOKOtros_Click(object sender, EventArgs e) { Insumos insumosOtros = (Insumos)cmbOtros.SelectedItem; if (cmbOtros.Items.Count == 0) { MessageBox.Show("No hay otros para quitar"); } else if (cmbOtros.SelectedIndex == -1) { MessageBox.Show("Debe seleccionar un elemento para quitar"); } else { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); insumoAccionBusiness.insumoSeleccionadoBtnNOk(insumosOtros, "otros", Convert.ToInt32(lblNroPedido.Text)); cargarMesa(); } }
private void btnAgregar_Click(object sender, EventArgs e) { InsumoBusiness insumoAccionBusiness = new InsumoBusiness(); Insumos insumos = new Insumos(); if (string.IsNullOrEmpty(txtPu.Text) || string.IsNullOrEmpty(txtDisponibles.Text) || string.IsNullOrEmpty(txtDescripcion.Text)) { MessageBox.Show("Debe completar la informacion"); return; } insumos.Pu = Convert.ToDecimal(txtPu.Text); insumos.Descripcion = txtDescripcion.Text; insumos.Disponibles = Convert.ToInt32(txtDisponibles.Text); insumoAccionBusiness.agregar(insumos, Text); MessageBox.Show(Text + " agregado correctamente"); txtPu.Clear(); txtDisponibles.Clear(); txtDescripcion.Clear(); }
private void btnOKBebida_Click(object sender, EventArgs e) { Insumos insumosBebida = (Insumos)cmbBebida.SelectedItem; if (insumosBebida.Disponibles == 0) { MessageBox.Show("No hay bebidas disponibles"); return; } else { InsumoAccionBusiness insumoAccionBusiness = new InsumoAccionBusiness(); cmbBebidas.Items.Add(cmbBebida.SelectedItem); Insumos insumos = (Insumos)cmbBebida.SelectedItem; cmbBebidas.Text = insumos.Descripcion.ToString(); lblPUBebida.Text = insumos.Pu.ToString(); insumosBebida.Disponibles--; insumoAccionBusiness.quitaInsumo(insumosBebida, "Bebida"); cargarMesa(); } }
private void btnOKPostre_Click(object sender, EventArgs e) { Insumos insumosPostre = (Insumos)cmbPostre.SelectedItem; if (insumosPostre.Disponibles == 0) { MessageBox.Show("No hay postres disponibles"); return; } else { InsumoAccionBusiness insumoAccionBusiness = new InsumoAccionBusiness(); cmbPostres.Items.Add(cmbPostre.SelectedItem); Insumos insumos = (Insumos)cmbPostre.SelectedItem; cmbPostres.Text = insumos.Descripcion.ToString(); lblPUPostre.Text = insumos.Pu.ToString(); insumosPostre.Disponibles--; insumoAccionBusiness.quitaInsumo(insumosPostre, "Postre"); cargarMesa(); } }
private void btnNOKEntrada_Click(object sender, EventArgs e) { Insumos insumosEntrada = (Insumos)cmbEntradas.SelectedItem; if (cmbEntradas.Items.Count == 0) { MessageBox.Show("No hay entradas para quitar"); } else if (cmbEntradas.SelectedIndex == -1) { MessageBox.Show("Debe seleccionar un elemento para quitar"); } else { InsumoAccionBusiness insumoAccionBusiness = new InsumoAccionBusiness(); lblPUEntrada.Text = insumosEntrada.Pu.ToString(); insumosEntrada.Disponibles++; cmbEntradas.Items.Remove(cmbEntradas.SelectedItem); insumoAccionBusiness.quitaInsumo(insumosEntrada, "Entrada"); cargarMesa(); } }
private void btnNOKPostre_Click(object sender, EventArgs e) { Insumos insumosPostre = (Insumos)cmbPostres.SelectedItem; if (cmbPostres.Items.Count == 0) { MessageBox.Show("No hay postres para quitar"); } else if (cmbPostres.SelectedIndex == -1) { MessageBox.Show("Debe seleccionar un elemento para quitar"); } else { InsumoAccionBusiness insumoAccionBusiness = new InsumoAccionBusiness(); cmbPostres.Items.Remove(cmbPostres.SelectedItem); lblPUPostre.Text = insumosPostre.Pu.ToString(); insumosPostre.Disponibles++; insumoAccionBusiness.quitaInsumo(insumosPostre, "Postre"); cargarMesa(); } }
private void cmbEntradas_SelectedIndexChanged(object sender, EventArgs e) { Insumos insumos = (Insumos)cmbEntrada.SelectedItem; lblPUEntrada.Text = insumos.Pu.ToString(); }
private void cmbPostre_SelectedIndexChanged(object sender, EventArgs e) { Insumos insumosPostre = (Insumos)cmbPostre.SelectedItem; lblDispPostre.Text = insumosPostre.Disponibles.ToString(); }
private void cmbComida_SelectedIndexChanged(object sender, EventArgs e) { Insumos insumosComida = (Insumos)cmbComida.SelectedItem; lblDispComida.Text = insumosComida.Disponibles.ToString(); }
private void cmbPostres_SelectedIndexChanged(object sender, EventArgs e) { Insumos insumos = (Insumos)cmbPostres.SelectedItem; lblPUPostre.Text = insumos.Pu.ToString(); }
private void cmbOtro_SelectedIndexChanged(object sender, EventArgs e) { Insumos insumosOtro = (Insumos)cmbOtro.SelectedItem; lblDispOtros.Text = insumosOtro.Disponibles.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()); }