//Ingresar Empeno private void btnInvoice_Click(object sender, EventArgs e) { if (txtNombre.Text.Equals("") || txtNombre.Text == null || txtNombre2.Text.Equals("") || txtNombre2.Text == null || txtApellido.Text.Equals("") || txtApellido.Text == null || txtApellido2.Text.Equals("") || txtApellido2.Text == null || txttel.Text.Equals("") || txttel.Text.Equals("") || txtCorreo_.Text.Equals("") || txtCorreo_.Text == null || txtCedula.Text.Equals("") || txtCedula.Text == null || txtDireccion.Text.Equals("") || txtDireccion.Text == null) { MessageBox.Show("Rellene Todos los Campos"); } else { ControladorCliente co = new ControladorCliente(); co.InsertarDatos(txtNombre.Text, txtNombre2.Text, txtApellido.Text, txtApellido2.Text, txttel.Text, txtCorreo_.Text, txtCedula.Text, txtDireccion.Text); ControlProducto cp = new ControlProducto(); cp.InsertarDatos(Convert.ToInt32(idTipo.SelectedValue), txtValor.Text , txtDescripcion.Text, txtNombreProducto.Text); ControlEmpeno c = new ControlEmpeno(); c.InsertarDatos(Convert.ToInt32(idEmpleado.SelectedValue), Convert.ToDouble(txtMonto_.Text) , Convert.ToInt32(txtCuota.Text), txtFrecuencia.Text, dateVencimiento_.Value.Date, txtCedula.Text, Convert.ToInt32(idTipo.SelectedValue), txtNombreProducto.Text); AccesoDatoUsuario acc = new AccesoDatoUsuario(); acc.TablaDePago(txtCedula.Text, txtFrecuencia.Text, txtMonto_.Text); MessageBox.Show("AGREGADO CORRECTAMENTE"); } }
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."); } } } }
//Evento cuando se mueve el focco // End Miscellaneous Methods //PARA MOSTRAR DATOS DE LA TABLA SEGUN EL CAMPO public void MostrarTabla(string a) { dgvPawns.DataSource = null; dgvPawns.DataSource = ControlEmpeno.mostrar(a); }