예제 #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.lstUiHorarios.Count == 0)
                {
                    throw new Exception("No se cargo el horario mensual");
                }

                Util.PointerLoad(this);

                bool rpta = new LN.Horario().Insertar(ref this.lstUiHorarios);

                if (rpta)
                {
                    Util.InformationMessage("Se guardo los datos del horario mensual");
                    this.frmList.CargarListadoHorarioMensual();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
            finally
            {
                Util.PointerReady(this);
            }
        }
예제 #2
0
        public void CargarHorarioSemanal()
        {
            try
            {
                var lstHorarios = new LN.Horario().ListarResumenSemanal();

                BindingSource source = new BindingSource();
                source.DataSource = lstHorarios;
                this.dgvHorarioSemanal.DataSource = lstHorarios;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #3
0
        public void CargarListadoHorarioMensual(int idSala = 0)
        {
            try
            {
                var lstHorarios = new LN.Horario().ListarResumenMensual(idSala);

                var source = new BindingSource();
                source.DataSource = lstHorarios;

                this.dgvHorariosMensuales.DataSource = lstHorarios;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
        public void CargarListadoHorarios(int idSala = 0)
        {
            try
            {
                var lstHorarios = new LN.Horario().ListarResumenSemanal(idSala);

                BindingSource source = new BindingSource();
                source.DataSource           = lstHorarios;
                this.dgvHorarios.DataSource = lstHorarios;

                this.FormatoListadoHorarios();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #5
0
        public void CargarListaComprometidos()
        {
            try
            {
                int     anho   = int.Parse(this.cboAnho.SelectedValue.ToString());
                int     mes    = int.Parse(this.cboMes.SelectedValue.ToString());
                BE.Sala beSala = (BE.Sala) this.cboSalas.SelectedItem;

                this.lstUiComprometidos = new LN.Comprometido().Listar(anho, mes, beSala.IdSala);

                if (this.lstUiComprometidos.Count == 0)
                {
                    var lstColaborados = new LN.Horario().ListarColaborados(anho, mes, beSala.IdSala);

                    foreach (BE.Record beColaborador in lstColaborados)
                    {
                        var uiComprometido = new BE.UI.Comprometido();

                        uiComprometido.SalaId                 = beSala.IdSala;
                        uiComprometido.SalaNombre             = beSala.Nombre;
                        uiComprometido.Anho                   = anho;
                        uiComprometido.Mes                    = mes;
                        uiComprometido.EmpleadoCodigo         = beColaborador.Codigo;
                        uiComprometido.EmpleadoNombreCompleto = beColaborador.Nombre;

                        this.lstUiComprometidos.Add(uiComprometido);
                    }
                }

                var source = new BindingSource();
                source.DataSource = this.lstUiComprometidos;

                this.dgvComprometidos.DataSource = source;
                this.txtNroRegistros.Text        = this.lstUiComprometidos.Count.ToString();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.lblHorarios.Text.Length == 0)
                {
                    return;
                }

                if (Util.ConfirmationMessage("¿Desea guardar el horario semanal?") == false)
                {
                    return;
                }

                for (int i = 0; i < this.lstUiHorarioNuevos.Count; i++)
                {
                    BE.UI.Horario uiHorarioNuevo = this.lstUiHorarioNuevos[i];
                    bool          exito          = new LN.Horario().Insertar(ref uiHorarioNuevo);
                }

                for (int i = 0; i < this.lstUiHorarioEliminados.Count; i++)
                {
                    BE.UI.Horario uiHorarioEliminado = this.lstUiHorarioEliminados[i];
                    bool          exito = new LN.Horario().Eliminar(uiHorarioEliminado.IdHorario);
                }

                Util.InformationMessage("Se guardo el horario semanal");

                this.frmList.CargarListadoHorarios();

                this.Close();
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }