コード例 #1
0
        private void BtnAgregar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (grillado == true)
                {
                    prestamo          p   = new prestamo();
                    Solicitud_Credito sc1 = (Solicitud_Credito)dgSolicitudes.SelectedItem;
                    p.Cliente             = sc1.Cliente;
                    p.moneda              = sc1.moneda;
                    p.pre_fecha           = (DateTime)dtpFecha.SelectedDate;
                    p.pre_montosolicitado = Convert.ToInt32(txtMonSolicitado.Text);
                    p.pre_montototal      = Convert.ToInt32(txtMonTotal.Text);
                    p.tipo_prestamo       = (tipo_prestamo)cmbTipo.SelectedItem;
                    p.pre_cantcuota       = Convert.ToInt32(txtCuotas.Text);
                    p.pre_interes         = Convert.ToInt32(txtInteres.Text);
                    db.prestamo.Add(p);
                    db.SaveChanges();

                    sc1.aprobado        = "X";
                    db.Entry(sc1).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();

                    CargarGrilla();
                    Limpiar();

                    MessageBox.Show("Registro Agregado Correctamente!");
                }
                else
                {
                    MessageBox.Show("Debe generar las cuotas");
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
コード例 #2
0
 private void AgregarPrestamo(prestamo p)
 {
 }