private void btagregar_Click(object sender, EventArgs e) { cuotas c = new cuotas(); c.fecha = ctfecha.Value; c.monto = float.Parse(ctmonto.Text); c.idcredito = credito.id; bd.cuotas.Add(c); bd.SaveChanges(); this.Close(); }
private void eliminarToolStripMenuItem_Click(object sender, EventArgs e) { int fila = gridcuotas.CurrentRow.Index; cuotas c = listacuota[fila]; DialogResult diag = MessageBox.Show("Desea eliminar esta Cuota?", "Eliminando Cuota", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (diag == DialogResult.OK) { bd.cuotas.Remove(c); bd.SaveChanges(); cargardatos(); } }
// https://codeshare.io/2WZjwE private void btguardar_Click(object sender, EventArgs e) { //Crear objeto de tipo cliente cliente cli = new cliente(); //Agregar datos al objeto cli.nombre = ctnombre.Text; cli.apellido = ctapellido.Text; cli.correo = ctcorreo.Text; cli.direccion = ctdireccion.Text; cli.telefono = cttelefono.Text; cli.edad = int.Parse(ctedad.Text); bd.cliente.Add(cli); bd.SaveChanges(); }
// https://codeshare.io/2WZjwE private void btguardar_Click(object sender, EventArgs e) { creditos cre = new creditos(); cre.fecha_fin = ctfechafin.Value; cre.fecha_inicio = ctfechainicio.Value; cre.interes = int.Parse(ctinteres.Text); cre.monto = double.Parse(ctmonto.Text); cre.monto_a_pagar = double.Parse(ctmontoapagar.Text); cre.plazo = int.Parse(ctplazo.Text); cre.monto_cuota = double.Parse(lbmontocuota.Text); cre.idcliente = cli.id; bd.creditos.Add(cre); bd.SaveChanges(); MessageBox.Show("Credito Guardado Correctamente", "Guardando Credito"); this.Close(); }