コード例 #1
0
        private void agregarNoLaborablesDelMes(Calendar.NET.Calendar c, int mes)
        {
            DateTime d;

            for (int i = 1; i < 32; i++)
            {
                try
                {
                    d = new DateTime(int.Parse(comboBox3.Text), mes, i);

                    if (m.existe_feriado(d))
                    {
                        m.agregar_feriado(d, "No laborable");
                        var ce = new Calendar.NET.HolidayEvent();
                        ce.IgnoreTimeComponent = true;
                        ce.EventText           = "No laborable";
                        ce.Date = new DateTime(d.Year, d.Month, d.Day, 0, 0, 0);
                        ce.RecurringFrequency = Calendar.NET.RecurringFrequencies.None;
                        ce.EventFont          = new Font("Verdana", 8, FontStyle.Regular);
                        ce.Enabled            = true;
                        ce.ReadOnlyEvent      = false;
                        //ce.EventColor=
                        c.AddEvent(ce);
                    }
                }
                catch (Exception ex) { }
            }
        }
コード例 #2
0
 private void quitarDia(DateTime d, string dias, DayOfWeek dof, Calendar.NET.Calendar c)
 {
     if (comboBox4.Text.Equals(dias))
     {
         if (d.DayOfWeek == dof)
         {
             c.RemoveEvent(d);
             m.borrar_feriado(d);
         }
     }
 }
コード例 #3
0
 private void afectarDia(DateTime d, string dias, DayOfWeek dof, Calendar.NET.Calendar c)
 {
     if (comboBox4.Text.Equals(dias))
     {
         if (d.DayOfWeek == dof)
         {
             var ce = new Calendar.NET.HolidayEvent();
             ce.IgnoreTimeComponent = true;
             ce.EventText           = "No laborable";
             ce.Date = new DateTime(d.Year, d.Month, d.Day, 0, 0, 0);
             ce.RecurringFrequency = Calendar.NET.RecurringFrequencies.None;
             ce.EventFont          = new Font("Verdana", 8, FontStyle.Regular);
             ce.Enabled            = true;
             ce.ReadOnlyEvent      = false;
             //ce.EventColor=
             c.AddEvent(ce);
             m.agregar_feriado(d, "No laborable");
         }
     }
 }
コード例 #4
0
        private void quitarTodosDelMes(Calendar.NET.Calendar c, int mes)
        {
            DateTime d;

            for (int i = 1; i < 32; i++)
            {
                try
                {
                    d = new DateTime(int.Parse(comboBox3.Text), mes, i);

                    quitarDia(d, "Lunes", DayOfWeek.Monday, c);
                    quitarDia(d, "Martes", DayOfWeek.Tuesday, c);
                    quitarDia(d, "Miercoles", DayOfWeek.Wednesday, c);
                    quitarDia(d, "Jueves", DayOfWeek.Thursday, c);
                    quitarDia(d, "Viernes", DayOfWeek.Friday, c);
                    quitarDia(d, "Sabados", DayOfWeek.Saturday, c);
                    quitarDia(d, "Domingos", DayOfWeek.Sunday, c);
                }
                catch (Exception ex) { }
            }
        }