private void btnAplicar_Click(object sender, EventArgs e) { try { if (DGVenta.Rows.Count != 0) { foreach (DataGridViewRow row in DGVenta.Rows) { row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(row.Cells[4].Value), Convert.ToDecimal(row.Cells[5].Value), Convert.ToDecimal(row.Cells[6].Value)), 2); } if (UtilityFrm.mensajeopcionsiono("Desea aplicar los cambios?") == true) { DataTable tablaArticulos = GrillaADataTable(DGVenta); string respuesta = NegocioArticulo.editarPrecioMasivo(tablaArticulos); UtilityFrm.mensajeConfirm("La actualizacion se realizo con exito"); DGVenta.Rows.Clear(); } } } catch (Exception s) { UtilityFrm.mensajeError(s.Message); } }
private void CBEquipo_KeyDown(object sender, KeyEventArgs e) { DataTable tabla = new DataTable(); if (e.KeyCode == Keys.Enter) { tabla = Negociogeneral.selecciondeconsultageneral("ordenservicio_equipo", "equipo", CBEquipo.Text); if (tabla.Rows.Count == 0) { if (UtilityFrm.mensajeopcionsiono("El nombre del equipo " + CBEquipo.Text + " no esta cargado en el sistema, desea agregarlo?") == true) { Negocioserviciotecnico.agregarequipo(CBEquipo.Text); string valor = ""; valor = CBEquipo.Text; UtilityFrm.completarcombobox(CBEquipo, "idequipo", "equipo", Negociogeneral.selecciondeconsultasinfiltro("ordenservicio_equipo")); CBEquipo.ValueMember = valor; } } } }
private void CBMod_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { DataTable tabla = new DataTable(); tabla = Negociogeneral.selecciondeconsultageneral("modelo", "modelo", CBMod.Text); if (tabla.Rows.Count == 0) { if (UtilityFrm.mensajeopcionsiono("El modelo " + CBMod.Text + " no esta cargado en el sistema, desea agregarlo?") == true) { Negocioserviciotecnico.agregarmodelo(CBMod.Text, Convert.ToInt32(CBMar.SelectedValue), Convert.ToInt32(CBEquipo.SelectedValue)); string valor = CBMod.Text; UtilityFrm.completarcombobox(CBMod, "idmodelo", "modelo", Negocioserviciotecnico.buscarmodelo(Convert.ToInt32(CBMar.SelectedValue), Convert.ToInt32(CBEquipo.SelectedValue))); CBMod.Text = valor; } else { CBMod.Text = ""; } } } }
private void CBMar_KeyDown(object sender, KeyEventArgs e) { DataTable tabla = new DataTable(); if (e.KeyCode == Keys.Enter) { tabla = Negociogeneral.selecciondeconsultageneral("marca", "marca", CBMar.Text); if (tabla.Rows.Count == 0) { if (UtilityFrm.mensajeopcionsiono("La marca" + CBMar.Text + " no esta cargado en el sistema, desea agregarlo?") == true) { Negocioserviciotecnico.agregarmarca(CBMar.Text); string valor = CBMar.Text; UtilityFrm.completarcombobox(CBMar, "idmarca", "marca", Negocioserviciotecnico.buscarmarca()); } else { CBMar.Text = ""; } } } }