private void frmAgregaPlatilloV2_Load(object sender, EventArgs e) { string[] numPedidos = dPedidos.arregloNumPedidos(); for (int i = 0; i < numPedidos.Length; i++) { cmbNumPe.Items.Add(numPedidos[i]); } string[] descripcion = listPlatillos.arregloDescripcion(); for (int i = 0; i < descripcion.Length; i++) { cmbDescripcion.Items.Add(descripcion[i]); } if (op != 1) { cmbNumPe.Enabled = false; cmbNumPe.Text = numPe.ToString(); string nombreC = admMesa.RegresaNombreCliente(numMesa); lblNombre.Text = nombreC; string[] Aclave = lPLaPedidos.RegresaPlatilloClaves(numPe); string[] Adesc = lPLaPedidos.RegresaPlatilloDescripcion(numPe); string[] Aimporte = lPLaPedidos.RegresaPlatilloImporte(numPe); string[] Atiempo = lPLaPedidos.RegresaPlatilloTiempo(numPe); for (int i = 0; i < Aclave.Length; i++) { dtgvPlatillo.Rows.Add(Aclave[i], Adesc[i], Aimporte[i], Atiempo[i]); } } }
private void frmConsultaPlatillos_Load(object sender, EventArgs e) { string[] clave = listPlatillos.arregloClave(); string[] desc = listPlatillos.arregloDescripcion(); string[] importe = listPlatillos.arregloImporte(); string[] tiempo = listPlatillos.arregloTiempo(); for (int i = 0; i < clave.Length; i++) { dgvConsultaPlatillos.Rows.Add(clave[i], desc[i], importe[i], tiempo[i]); } }
private void btnRegistrar_Click(object sender, EventArgs e) { if (ValidarDescripcion()) { if (ValidarImporte()) { if (ValidarDuplicado()) { string ClavePlatillo = txtClavePlatillo.Text; string desc = txtDescripcion.Text; double importe = Convert.ToDouble(txtImportePlatillo.Text); int tiempo = Convert.ToInt32(numUpTiempo.Value); listPlatillos.AgregaPlatillo(desc, importe, tiempo); MessageBox.Show("Platillo Agregado Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); //Limpiar ErrorProvider ErrorPPlatillos.SetError(txtDescripcion, ""); ErrorPPlatillos.SetError(txtImportePlatillo, ""); DataGPlatillos.Rows.Clear(); string[] Aclave = listPlatillos.arregloClave(); string[] Adesc = listPlatillos.arregloDescripcion(); string[] Aimporte = listPlatillos.arregloImporte(); string[] Atiempo = listPlatillos.arregloTiempo(); for (int i = 0; i < Aclave.Length; i++) { DataGPlatillos.Rows.Add(Aclave[i], Adesc[i], Aimporte[i], Atiempo[i]); } //Limpiar Al Registrar txtDescripcion.Text = ""; txtImportePlatillo.Text = "0"; numUpTiempo.Value = 10; txtClavePlatillo.Text = Platillo.ObtieneClave().ToString(); txtDescripcion.Focus(); } } } }