Пример #1
0
        private void GetCheque(Int32 CodCheque)
        {
            cChequeCobrar cheque = new cChequeCobrar();
            DataTable     trdo   = cheque.GetChequexCodigo(CodCheque);

            if (trdo.Rows.Count > 0)
            {
                DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["Fecha"].ToString());

                Int32? CodBanco = null;
                string Nombre   = "";
                string Apellido = "";
                Double Importe  = 0;
                string Patente  = "";

                if (trdo.Rows[0]["Vencimiento"].ToString() != "")
                {
                    DateTime Vencimiento = Convert.ToDateTime(trdo.Rows[0]["Vencimiento"].ToString());
                    txtVencimiento.Text = Vencimiento.ToShortDateString();
                }
                if (trdo.Rows[0]["CodBanco"].ToString() != "")
                {
                    CodBanco = Convert.ToInt32(trdo.Rows[0]["CodBanco"].ToString());
                }
                Nombre   = trdo.Rows[0]["Nombre"].ToString();
                Apellido = trdo.Rows[0]["Apellido"].ToString();
                Patente  = trdo.Rows[0]["Patente"].ToString();
                Importe  = Convert.ToDouble(trdo.Rows[0]["Importe"].ToString());

                txtNombre.Text     = Nombre;
                txtApellido.Text   = Apellido;
                txtImporte.Text    = Importe.ToString();
                txtFecha.Text      = Fecha.ToShortDateString();
                txtTelefono.Text   = trdo.Rows[0]["Telefono"].ToString();
                txtPatente.Text    = Patente;
                txtEntregadoa.Text = trdo.Rows[0]["EntregadoA"].ToString();
                if (trdo.Rows[0]["CodBanco"].ToString() != "")
                {
                    cmbBanco.SelectedValue = trdo.Rows[0]["CodBanco"].ToString();
                }
                txtNumeroCheque.Text = trdo.Rows[0]["NumeroCheque"].ToString();
            }
        }