Example #1
0
 private void cargarDestino()
 {
     cmbDestino.DisplayMember = "DES_Descripcion";
     cmbDestino.ValueMember   = "DES_Codigo";
     cmbDestino.DataSource    = GestionDestino.list();
     cmbDestino.SelectedIndex = -1;
 }
Example #2
0
 private void FrmAltaDestino_Load(object sender, EventArgs e)
 {
     txtCodigo.Enabled = false;
     if (!modificar)
     {
         int ultimoID = Convert.ToInt32(GestionDestino.Get_UltimoID().Rows[0][0]) + 1;
         txtCodigo.Text = ultimoID.ToString();
     }
 }
Example #3
0
        public void agregarDestino()
        {
            frmGestionDestino = FrmGestionDestino.GetInstancia();
            Destino destino = new Destino();

            destino.Des_Descripcion = txtDescripcion.Text;
            GestionDestino.insert_Destino(destino);
            MessageBox.Show("Destino agregado con éxito", "Agregar destino", MessageBoxButtons.OK, MessageBoxIcon.Information);
            frmGestionDestino.cargar_Destinos();
            this.Close();
        }
 private void cargarDetallePrestamo()
 {
     txtPrestamo.Text = prestamo.Pre_Numero.ToString();
     txtDNI.Text      = prestamo.Cli_Dni;
     txtDestino.Text  = GestionDestino.Get_Destino(prestamo.Des_Codigo);
     txtPeriodo.Text  = GestionPrestamo.GetPeriodo(prestamo.Per_Codigo).Rows[0][1].ToString();
     txtImporte.Text  = prestamo.Pre_Importe.ToString();
     txtInteres.Text  = prestamo.Pre_TasaInteres.ToString();
     txtCuotas.Text   = prestamo.Pre_CantidadCuotas.ToString();
     txtEstado.Text   = prestamo.Pre_Estado;
     dtpFecha.Text    = prestamo.Pre_Fecha.ToShortDateString();
 }
Example #5
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogResult opcion;

            opcion = MessageBox.Show("¿Desea eliminar el destino: " + this.destino.Des_Descripcion + " ?", "Eliminar destino", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
            if (opcion.Equals(DialogResult.Yes))
            {
                if (GestionDestino.devolverTienePrestamo(Convert.ToInt32(this.destino.Des_Codigo)) > 0)
                {
                    MessageBox.Show("No se puede eliminar el destino porque tiene préstamo asignado", "Eliminar destino", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    GestionDestino.delete_Destino(destino);
                    MessageBox.Show("Destino eliminado con éxito", "Eliminar destino", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    cargar_Destinos();
                }
            }
        }
Example #6
0
 public void cargar_Destinos()
 {
     dgwDestino.DataSource            = GestionDestino.list_Destino();
     dgwDestino.Columns["ID"].Visible = false;
 }
Example #7
0
 private void modificar_Destino()
 {
     GestionDestino.update_Destino(this.destino);
     MessageBox.Show("Destino modificado con éxito", "Modificar destino", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
Example #8
0
 private bool validar_Destino()
 {
     return(GestionDestino.validar_Destino(destino).Rows.Count == 0);
 }