Пример #1
0
        private void BtnGenerarPlanillas_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show(ObtenerLeyenda("msgConfirmacionGenerarPlanillas"), "",
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                try
                {
                    Cursor = Cursors.WaitCursor;
                    GeneradorDePlanillas.GenerarProximasPlanillas();
                    Cursor = Cursors.Default;

                    MessageBox.Show(ObtenerLeyenda("msgGeneracionPlanillasOk"));

                    RefrescarGeneracionPlanillas();

                    (MdiParent as MainForm).ChequearAlertasDeInsuficiencia();
                }
                catch (Exception ex)
                {
                    Log.Grabar(ex);
                    MessageBox.Show(ObtenerLeyenda("msgErrorAlGenerarPlanillas"), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #2
0
        private void RefrescarGeneracionPlanillas()
        {
            DateTime ultimaFecha = PlanillaHoraria.ObtenerUltimaPlanilla();

            if (ultimaFecha == default)
            {
                lblUltimaPlanillaInfo.Text = ObtenerLeyenda("msgNoHayPlanillas");
            }
            else
            {
                string leyendaUltimaPlanillaInfo = ObtenerLeyenda("lblUltimaPlanillaInfo");
                if (leyendaUltimaPlanillaInfo.Contains("{0}"))
                {
                    lblUltimaPlanillaInfo.Text = string.Format(leyendaUltimaPlanillaInfo, ultimaFecha.ToString("dd/MM/yyyy"));
                }
            }

            DateTime proximaFecha            = GeneradorDePlanillas.ObtenerProximaFecha(ultimaFecha, out bool puedeGenerarse);
            string   leyendaGenerarPlanillas = ObtenerLeyenda("btnGenerarPlanillas");

            if (leyendaGenerarPlanillas.Contains("{0}"))
            {
                btnGenerarPlanillas.Text = string.Format(leyendaGenerarPlanillas, proximaFecha.ToString("dd/MM/yyyy"));
            }
            btnGenerarPlanillas.Enabled = puedeGenerarse;
        }
Пример #3
0
        public void deberia_poder_generar_una_planilla_para_un_curso_y_mes()
        {
            Curso un_curso = TestObjects.UnCursoConAlumnos();

            GeneradorDePlanillas generador = new GeneradorDePlanillas();

            Assert.IsNotNull(generador.GenerarPlanillaMensualPara(un_curso, fecha_desde, fecha_hasta));
        }
Пример #4
0
        public void deberia_poder_conocer_los_dias_de_cursada_de_un_curso_para_un_mes()
        {
            Curso un_curso = TestObjects.UnCursoConAlumnos();

            managerDeCalendarios.AgregarCalendarioPara(un_curso);
            GeneradorDePlanillas generador = new GeneradorDePlanillas();

            CalendarioDeCurso un_calendario = managerDeCalendarios.CalendarioPara(un_curso);  //new CalendarioDeCurso(un_curso, new CalendarioDeFeriados() ); //Se cambió por el Manager
            PlanillaMensual   una_planilla  = generador.GenerarPlanillaMensualPara(un_curso, fecha_desde, fecha_hasta, un_calendario);

            Assert.AreEqual(6, una_planilla.GetDiasDeCursadaEntre(fecha_desde, fecha_hasta).Count());
        }