Exemplo n.º 1
0
 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);
        }
Exemplo n.º 4
0
 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();
     }
 }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
 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();
     }
 }