private void button1_Click(object sender, EventArgs e) { if (txtFrecuencia.Text.Equals("") || txtFrecuencia.Text == null || txtMonto_.Text == null || txtMonto_.Text.Equals("")) { MessageBox.Show("OBLIGATORIO LLENAR CAMPO FRECUENCIA Y MONTO"); } else { cuota.Text = ""; DataTable dt = new DataTable(); dt = ControlEmpeno.mostrarTablaAmortizacion(txtFrecuencia.Text, txtMonto_.Text); var cell = dt.Rows[0][4]; cuota.Text = cell.ToString(); } // MessageBox.Show(cuota.Text = Convert.ToString(ControlEmpeno.mostrarTablaAmortizacion("2", txtMonto_.Text).Rows[0])); }
private void button4_Click(object sender, EventArgs e) { if (dgvPagos.SelectedRows == null) { } else { SetTabInactiveEffect(lblPawnsTab, null); SetTabInactiveEffect(lblnewPawnTab, null); SetTabActiveEffect(lblPayTab, null); tabControl.SelectedTab = payTabPage; txtNombreP.Text = dgvPawns.CurrentRow.Cells[9].Value.ToString(); txtDescripP.Text = dgvPawns.CurrentRow.Cells[10].Value.ToString(); txtTipoP.Text = dgvPawns.CurrentRow.Cells[11].Value.ToString(); dgvPagos.DataSource = null; dgvPagos.DataSource = ControlEmpeno.mostrarTablaAmortizacion(cmbFrecuencia.Text, txtMonto.Text); } }
public string TablaDePago(string cedula, string frecuencia, string monto) { using (var connection = GetConnection()) { connection.Open(); using (var command = new SqlCommand()) { command.Connection = connection; command.CommandText = "sp_BuscarClient"; command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@cedula", cedula); DataTable t = new DataTable(); t = ControlEmpeno.mostrarTablaAmortizacion(frecuencia, monto); SqlDataReader reader = command.ExecuteReader(); if (reader.Read() == true) { string Nombre = reader.GetString(0); string email = reader.GetString(1); var correo_ = new SoporteEmail(); correo_.EnviarEmailAmort(sujeto: "TABLA DE AMORTIZACION DE PAGO", cuerpo: t, destinatario: new List <string> { email }); return("Porfavor revice su correo."); } else { return("Lo sentimos, no cuenta con un correo electronico."); } } } }