protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Prestamos prestamo = new Prestamos(); PrestamosGridView.DataSource = prestamo.Listado("*", "1=1", ""); PrestamosGridView.DataBind(); } }
private void CargarDropList() { Prestamos prestamo = new Prestamos(); clienteCobroDropDownList.DataSource = prestamo.Listado("PrestamoId,Nombres", "1=1", ""); clienteCobroDropDownList.DataTextField = "Nombres"; clienteCobroDropDownList.DataValueField = "PrestamoId"; clienteCobroDropDownList.DataBind(); }
protected void clienteCobroDropDownList_SelectedIndexChanged1(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); cuotaCobroDropDownList.DataSource = prestamo.Listado("PrestamoId,Cuota", "PrestamoId = " + clienteCobroDropDownList.SelectedValue, ""); cuotaCobroDropDownList.DataTextField = "Cuota"; cuotaCobroDropDownList.DataValueField = "Cuota"; cuotaCobroDropDownList.DataBind(); }
private void prestamoConsultabutton_Click(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); DataTable data = new DataTable(); string condicion; if (prestamocomboBox.SelectedIndex == 0) { if (prestamotextBox.Text.Trim().Length == 0) { condicion = "1=1 "; } else { int id; int.TryParse(prestamotextBox.Text, out id); condicion = "PrestamoId= " + id.ToString(); } data = prestamo.Listado("ClienteId,RutaId,SemanaNo,ValorCuota,Monto,Cuota", condicion, ""); PrestamodataGridView.DataSource = data; } if (prestamocomboBox.SelectedIndex == 1) { if (prestamotextBox.Text.Trim().Length == 1) { condicion = "2=2 "; } else { int id; int.TryParse(prestamotextBox.Text, out id); condicion = " Monto= " + id.ToString(); } data = prestamo.Listado("ClienteId,RutaId,SemanaNo,ValorCuota,Monto,Cuota", condicion, ""); PrestamodataGridView.DataSource = data; } }
protected void consultaPrestamoButton_Click(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); string Filtro = ""; if (PrestamoFTextBox.Text.Trim().Length == 0) { Filtro = "1=1"; } else { Filtro = ConsultaPrestamosDropDownList.SelectedValue + " like '%" + PrestamoFTextBox.Text + "%'"; } PrestamosGridView.DataSource = prestamo.Listado("*", Filtro, ""); PrestamosGridView.DataBind(); }
private void BuscarButton_Click(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); string filtro = ""; if (FiltroComboBox.SelectedIndex < 0 || FiltroTextBox.Text == "") { MessageBox.Show("Llene los campos requeridos"); } else { if (FiltroTextBox.Text.Length > 0) { filtro = FiltroComboBox.Text + " like '%" + FiltroTextBox.Text + "%'"; } ConsultaDataGridView.DataSource = prestamo.Listado("PrestamoId,ClienteId,FechaInicial,FechaVencimiento,Monto,NuSemana,CantidadCuota,Interes,Cuota,PagoTotal ", filtro, ""); } }
private void RegistroAtrasos_Load(object sender, EventArgs e) { AtrasocomboBox.DataSource = prestamo.Listado("*", "1=1", ""); AtrasocomboBox.DisplayMember = "PrestamoId"; AtrasocomboBox.ValueMember = "PrestamoId"; }