Example #1
0
        private void GetClientexCodigo(Int32 CodCliente)
        {
            cCliente  cli  = new cCliente();
            DataTable trdo = cli.GetClientexCodigo(CodCliente);

            if (trdo.Rows.Count > 0)
            {
                txtCodCliente.Text   = trdo.Rows[0]["CodCliente"].ToString();
                txtNroDocumento.Text = trdo.Rows[0]["NroDocumento"].ToString();
                txtNombre.Text       = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text     = trdo.Rows[0]["Apellido"].ToString();
                txtTelefono.Text     = trdo.Rows[0]["Telefono"].ToString();
                txtCuit.Text         = trdo.Rows[0]["Cuit"].ToString();
                txtDireccion.Text    = trdo.Rows[0]["Direccion"].ToString();
            }
        }
Example #2
0
        private void BuscarVenta(Int32 CodVenta)
        {
            btnGrabarVenta.Enabled = false;
            btnCancelar.Enabled    = false;
            tbVenta.Clear();
            cVenta    venta = new cVenta();
            DataTable trdo  = venta.GetDetalleVenta(CodVenta);

            for (int i = 0; i < trdo.Rows.Count; i++)
            {
                string  CodInsumo = trdo.Rows[i]["CodInsumo"].ToString();
                string  Nombre    = trdo.Rows[i]["Nombre"].ToString();
                string  Cantidad  = trdo.Rows[i]["Cantidad"].ToString();
                string  Precio    = trdo.Rows[i]["Precio"].ToString();
                string  Subtotal  = trdo.Rows[i]["Subtotal"].ToString();
                DataRow r         = tbVenta.NewRow();
                r[0] = CodInsumo.ToString();
                r[1] = Nombre;
                r[2] = Cantidad;
                r[3] = Precio;
                r[4] = Subtotal;
                tbVenta.Rows.Add(r);
            }
            Grilla.DataSource         = tbVenta;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Width   = 310;
            DataTable tb = venta.GetVenta(CodVenta);

            if (tb.Rows.Count > 0)
            {
                if (tb.Rows[0]["Efectivo"].ToString() != "")
                {
                    Double Efectivo = 0;
                    Efectivo         = Convert.ToDouble(tb.Rows[0]["Efectivo"].ToString());
                    txtEfectivo.Text = fun.SepararDecimales(Efectivo.ToString());
                    txtEfectivo.Text = fun.FormatoEnteroMiles(Efectivo.ToString());
                }
                if (tb.Rows[0]["CodCliente"].ToString() != "")
                {
                    if (tb.Rows[0]["CodCliente"].ToString() != "")
                    {
                        Int32     CodCliente = Convert.ToInt32(tb.Rows[0]["CodCliente"].ToString());
                        cCliente  cliente    = new cCliente();
                        DataTable tbCliente  = cliente.GetClientexCodigo(CodCliente);
                        if (tbCliente.Rows.Count > 0)
                        {
                            txtCodCliente.Text   = tbCliente.Rows[0]["CodCliente"].ToString();
                            txtNombre.Text       = tbCliente.Rows[0]["Nombre"].ToString();
                            txtApellido.Text     = tbCliente.Rows[0]["Apellido"].ToString();
                            txtNroDocumento.Text = tbCliente.Rows[0]["NroDocumento"].ToString();
                            txtTelefono.Text     = tbCliente.Rows[0]["Telefono"].ToString();
                            if (tbCliente.Rows[0]["CodTipoDoc"].ToString() != "")
                            {
                                string CodTipoDoc = tbCliente.Rows[0]["CodTipoDoc"].ToString();
                                if (cmbTipoDoc.Items.Count > 0)
                                {
                                    cmbTipoDoc.SelectedValue = CodTipoDoc;
                                }
                            }
                        }
                    }
                }

                cDocumento doc  = new cDocumento();
                DataTable  tdoc = doc.GetDocumentoxCodVenta(CodVenta);
                if (tdoc.Rows.Count > 0)
                {
                    if (tdoc.Rows[0]["Importe"].ToString() != "")
                    {
                        Double Importe = Convert.ToDouble(tdoc.Rows[0]["Importe"].ToString());
                        txtDocumento.Text = Importe.ToString();
                        txtDocumento.Text = fun.SepararDecimales(txtDocumento.Text);
                        txtDocumento.Text = fun.FormatoEnteroMiles(txtDocumento.Text);
                    }
                }
                else
                {
                    txtDocumento.Text = "0";
                }
            }
            BuscarTarjetaxCodVenta(CodVenta);
            BuscarCheque(CodVenta);
        }