예제 #1
0
        /// <summary>
        /// verifica si el codigo a grabar está entre los codigos que tienen contenido=1
        /// en la tabla asistencia. Éstos codigos son los que deben solicitar informacion
        /// para almacenar las vacaciones.
        /// </summary>
        /// <returns></returns>
        private bool verificaVacaciones(double dias)
        {
            bool         ok     = false;;
            DbDataReader rsAsis = Model.DB.ejecutarDataReader(Model.TipoComando.SP, "tablasConsultarContenidoYdetalle", "@tabla", "Asistencia", "@indice", this.cmbNovedades.SelectedValue);

            while (rsAsis.Read())
            {
                if (rsAsis["contenido"].ToString() == "1")
                {
                    frmVacacionesEmpleado frmVac = new frmVacacionesEmpleado();
                    ok = frmVac.abrirParaCargar(this.dtpFecha.Value.Year.ToString(), this.dtpFecha.Value.Month.ToString(), dias.ToString(), Convert.ToInt32(this.cmbEmpleados.SelectedValue), this.dtpDesde.Value, Convert.ToInt32(this.cmbNovedades.SelectedValue));
                }
                else
                {
                    ok = true;
                }
            }
            Model.DB.desconectarDB();
            return(ok);
        }
예제 #2
0
        /// <summary>
        /// verifica si el codigo a grabar está entre los codigos que tienen contenido=1
        /// en la tabla asistencia. Éstos codigos son los que deben solicitar informacion
        /// para almacenar las vacaciones.
        /// </summary>
        /// <returns></returns>
        private bool verificaVacaciones(double dias)
        {
            bool ok = false; ;
            DbDataReader rsAsis = Model.DB.ejecutarDataReader(Model.TipoComando.SP,"tablasConsultarContenidoYdetalle", "@tabla", "Asistencia", "@indice", this.cmbNovedades.SelectedValue);
            while (rsAsis.Read())
            {
                if (rsAsis["contenido"].ToString() == "1")
                {
                    frmVacacionesEmpleado frmVac = new frmVacacionesEmpleado();
                    ok = frmVac.abrirParaCargar(this.dtpFecha.Value.Year.ToString(), this.dtpFecha.Value.Month.ToString(), dias.ToString(), Convert.ToInt32(this.cmbEmpleados.SelectedValue), this.dtpDesde.Value, Convert.ToInt32(this.cmbNovedades.SelectedValue));
                }
                else
                    ok = true;

            }
            Model.DB.desconectarDB();
            return ok;
        }
예제 #3
0
 private void btnNuevoVacaciones_Click(object sender, EventArgs e)
 {
     VacacionEntity original = new VacacionEntity();
     original.Legajo = this.empleado.Legajo;
     original.AnioVacaciones = DateTime.Now.Year;
     frmVacacionesEmpleado frmv = new frmVacacionesEmpleado();
     frmv.abrirParaNuevo(ref original);
     if (frmv.Ok)
     {
         empleado.Vacaciones.Add(original);
         this.btnGrabar.Enabled = true;
         //this.empleado.Vacaciones.cargarDataGridView(this.dgvVacaciones);
         this.cargarDGVvacaciones(this.dgvVacaciones);
     }
 }
예제 #4
0
 private void btnModificarVacaciones_Click(object sender, EventArgs e)
 {
     VacacionEntity original = null; ;
     frmVacacionesEmpleado frmv = new frmVacacionesEmpleado();
     original = empleado.Vacaciones[Convert.ToInt32(Controles.consultaRenglonSeleccionado(this.dgvVacaciones))];
     frmv.abrirParaModificar(ref original);
     if (frmv.Ok)
     {
         this.btnGrabar.Enabled = true;
         //this.empleado.Vacaciones.cargarDataGridView(this.dgvVacaciones);
         this.cargarDGVvacaciones(this.dgvVacaciones);
     }
 }