Пример #1
0
        public void GetAutoPartePago(Int32 CodVenta)
        {
            Clases.cFunciones fun  = new Clases.cFunciones();
            Clases.cVenta     obj  = new Clases.cVenta();
            DataTable         trdo = obj.GetAutosPartePago(CodVenta);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["CodAuto"].ToString() != "")
                {
                    string sImporte = trdo.Rows[0]["Importe"].ToString();
                    if (sImporte != "" && sImporte != "0")
                    {
                        sImporte = fun.SepararDecimales(sImporte);
                        sImporte = fun.FormatoEnteroMiles(sImporte);
                    }
                    Int32        CodAuto = Convert.ToInt32(trdo.Rows[0]["CodAuto"].ToString());
                    Clases.cAuto auto    = new Clases.cAuto();
                    DataTable    tauto   = auto.GetAutoxCodigo(CodAuto);
                    {
                        if (tauto.Rows.Count > 0)
                        {
                            string Descrip = " Un vehículo" + tauto.Rows[0]["Marca"].ToString() + " " + tauto.Rows[0]["Descripcion"].ToString();
                            Descrip = Descrip + " MOTOR N º" + tauto.Rows[0]["Motor"].ToString();
                            Descrip = Descrip + " CHASIS N º" + tauto.Rows[0]["Chasis"].ToString();
                            Descrip = Descrip + " AÑO " + tauto.Rows[0]["Anio"].ToString();
                            Descrip = Descrip + " DOMINIO " + tauto.Rows[0]["Patente"].ToString();
                            Descrip = Descrip + " valuado en " + sImporte;
                            txtAutoPartePago.Text = Descrip;
                        }
                    }
                }
            }
        }
Пример #2
0
 private void FrmCobroCheque_Load(object sender, EventArgs e)
 {
     if (Principal.CodigoPrincipalAbm != null)
     {
         Int32        CodAuto = Convert.ToInt32(Principal.CodigoPrincipalAbm);
         Clases.cAuto auto    = new Clases.cAuto();
         DataTable    trdo    = auto.GetAutoxCodigo(CodAuto);
         if (trdo.Rows.Count > 0)
         {
             string Patente = trdo.Rows[0]["Patente"].ToString();
             txtPatente.Text = Patente;
             CargarGrilla();
         }
     }
 }
Пример #3
0
 private void CargarImagen(Int32 CodAuto)
 {
     try
     {
         cAuto     auto = new Clases.cAuto();
         DataTable trdo = auto.GetAutoxCodigo(CodAuto);
         if (trdo.Rows.Count > 0)
         {
             if (trdo.Rows[0]["RutaImagen"].ToString() != "")
             {
                 string Ruta = trdo.Rows[0]["RutaImagen"].ToString();
                 Imagen.Image = System.Drawing.Image.FromFile(Ruta);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("No se pudo cargar la imagen");
     }
 }
Пример #4
0
        private void UbicarProvincia(Int32 CodAuto)
        {
            cAuto     auto = new Clases.cAuto();
            DataTable trdo = auto.GetAutoxCodigo(CodAuto);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["CodProvincia"].ToString() != "")
                {
                    Int32 CodProv = Convert.ToInt32(trdo.Rows[0]["CodProvincia"].ToString());
                    cmbProvincia.SelectedValue = CodProv;
                    cCiudad    ciudad = new Clases.cCiudad();
                    DataTable  tr     = ciudad.GetCiudadxCodProvincia(CodProv);
                    cFunciones fun    = new cFunciones();
                    fun.LlenarComboDatatable(cmb_CodCiudad, tr, "Nombre", "CodCiudad");
                    if (trdo.Rows[0]["CodCiudad"].ToString() != "")
                    {
                        string CodCiudad = trdo.Rows[0]["CodCiudad"].ToString();
                        cmb_CodCiudad.SelectedValue = CodCiudad.ToString();
                    }
                }
            }
        }
Пример #5
0
        private void CargarDatos(Int32 CodVenta)
        {
            GetAutoPartePago(CodVenta);
            Clases.cCliente cliente = new Clases.cCliente();
            Clases.cVenta   venta   = new Clases.cVenta();
            DataTable       trdo    = venta.GetVentaxCodigo(CodVenta);

            if (trdo.Rows.Count > 0)
            {
                Int32     CodCliente = Convert.ToInt32(trdo.Rows[0]["CodCliente"].ToString());
                DataTable tcli       = cliente.GetClientesxCodigo(CodCliente);
                if (tcli.Rows.Count > 0)
                {
                    string nombre = tcli.Rows[0]["Nombre"].ToString();
                    nombre = nombre + " " + tcli.Rows[0]["Apellido"].ToString();
                    string Direccion = tcli.Rows[0]["Calle"].ToString();
                    Direccion         = Direccion + " " + tcli.Rows[0]["Numero"].ToString();
                    txtDireccion.Text = Direccion;
                    txtTelefono.Text  = tcli.Rows[0]["Telefono"].ToString();
                    txtNombre.Text    = nombre;
                }
            }
            txtEfectivo.Text   = trdo.Rows[0]["ImporteEfectivo"].ToString();
            txtDocumentos.Text = trdo.Rows[0]["ImporteCredito"].ToString();
            Int32 CodAuto = Convert.ToInt32(trdo.Rows[0]["CodAutoVendido"].ToString());

            Clases.cAuto auto  = new Clases.cAuto();
            DataTable    tauto = auto.GetAutoxCodigo(CodAuto);

            {
                if (tauto.Rows.Count > 0)
                {
                    string Descrip = tauto.Rows[0]["Descripcion"].ToString();
                    Descrip      = Descrip + " AÑO " + tauto.Rows[0]["Anio"].ToString();
                    Descrip      = Descrip + " DOMINIO " + tauto.Rows[0]["Patente"].ToString();
                    Descrip      = Descrip + " MOTOR N º" + tauto.Rows[0]["Motor"].ToString();
                    Descrip      = Descrip + " CHASIS N º" + tauto.Rows[0]["Chasis"].ToString();
                    txtAuto.Text = Descrip;
                }
            }
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtEfectivo.Text != "0" && txtEfectivo.Text != "")
            {
                txtEfectivo.Text = fun.SepararDecimales(txtEfectivo.Text);
                txtEfectivo.Text = fun.FormatoEnteroMiles(txtEfectivo.Text);
            }

            if (txtDocumentos.Text != "0" && txtDocumentos.Text != "")
            {
                txtDocumentos.Text = fun.SepararDecimales(txtDocumentos.Text);
                txtDocumentos.Text = fun.FormatoEnteroMiles(txtDocumentos.Text);
            }
            Clases.cPrenda prenda     = new Clases.cPrenda();
            DataTable      trdoPrenda = prenda.GetPrendaxCodVenta(Convert.ToInt32(Principal.CodigoPrincipalAbm));

            if (trdoPrenda.Rows.Count > 0)
            {
                string Importe = trdoPrenda.Rows[0]["Importe"].ToString();
                Importe = fun.SepararDecimales(Importe);
                Importe = fun.FormatoEnteroMiles(Importe);
                txtImportePrenda.Text = Importe;
            }
        }