public frm_detalle_pv(int seleccionada, int unidadSeleccionada) { InitializeComponent(); uService = new UnidadService(); pvService = new PostVentaService(); this.pvSeleccionado = pvService.getPostVentaMasDetalle(seleccionada, unidadSeleccionada); this.uSeleccionada = uService.getUnidadPorId(unidadSeleccionada); }
private void dgv_stock_unidades_CurrentCellChanged(object sender, EventArgs e) { int id; if (dgv_stock_unidades.CurrentRow != null) { Unidad unidad = service.getUnidadPorId(Convert.ToInt32(dgv_stock_unidades.CurrentRow.Cells["col_id_unidad"].Value.ToString())); cargarDatos(unidad); id = Convert.ToInt32(dgv_stock_unidades.CurrentRow.Cells["col_id_unidad"].Value.ToString()); try { pic_unidad.Image = Image.FromFile(Path.Combine(Application.StartupPath, "Imagenes/StockUnidades/" + id + ".jpg")); } catch (System.IO.FileNotFoundException) { pic_unidad.Image = (Image)Resources.errorUnidadBig; } } }
private PostVenta mapper(DataRow fila) { PostVenta service = new PostVenta(); service.IdService = Convert.ToInt32(fila["codService"].ToString()); service.unidad = uService.getUnidadPorId(Convert.ToInt32(fila["codUnidad"].ToString())); service.FechaService = Convert.ToDateTime(fila["fechaService"].ToString()); service.Kmlimite = Convert.ToInt64(fila["kmLimite"].ToString()); return(service); }
private void btn_edit_uni_Click(object sender, EventArgs e) { if (dgv_stock_unidades.CurrentRow == null) { MessageBox.Show("No se selecciono ninguna unidad", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { Unidad seleccionada = uService.getUnidadPorId(Convert.ToInt32(dgv_stock_unidades.CurrentRow.Cells[0].Value.ToString())); Form aux = new frm_edit_unidad(seleccionada); aux.ShowDialog(); } }
public void addDetail(int idUnidad) { Unidad unidad = service.getUnidadPorId(idUnidad); detalles.Add(idUnidad); peso = Convert.ToInt64(unidad.PrecioVenta * (long)cotizacion); dgv_details.Rows.Add(new object[] { unidad.CodUnidad.ToString(), unidad.NombreFabricante.ToString(), unidad.Nombre.ToString(), unidad.AƱoModelo.ToString(), unidad.NombreGeneracion.ToString(), unidad.PrecioVenta.ToString(), peso.ToString() }); total += Convert.ToInt64(unidad.PrecioVenta); txt_total_dolar.Text = total.ToString(); txt_total_peso.Text = (total * cotizacion).ToString(); }
private void txt_unidad_TextChanged(object sender, EventArgs e) { txt_patente.Clear(); txt_modelo.Clear(); dgv_pv_interno.Rows.Clear(); dgv_unidadesInternas.Rows.Clear(); if (!String.IsNullOrWhiteSpace(txt_unidad.Text)) { Unidad unidad = uService.getUnidadPorId(Convert.ToInt32(txt_unidad.Text)); dgv_unidadesInternas.Rows.Clear(); dgv_unidadesInternas.Rows.Add ( new object[] { unidad.CodUnidad.ToString(), unidad.NombreFabricante, unidad.Nombre, unidad.NombreGeneracion, unidad.AƱoModelo.ToString(), unidad.Patente } ); } else { dgv_unidadesInternas.Rows.Clear(); } }