static void Main(string[] args) { var startDate = new DateTime(Convert.ToInt32(args[1]), Convert.ToInt32(args[0]),01); var endDate = startDate.AddDays(DateTime.DaysInMonth(startDate.Year, startDate.Month)).AddDays(-1); var calendarUtils = new CalendarUtils(_holidayTerms,_ascTerms); var service = calendarUtils.CreateService(ApplicationName); var days = calendarUtils.GenerateDays(startDate, endDate, service); calendarUtils.GenerateCalendar(startDate, days,Color.LimeGreen, Color.BurlyWood); }
private void button1_Click(object sender, EventArgs e) { pictureBox1.Visible = true; char[] charSeparators = new char[] { ',' }; button1.Enabled = false; var startDate = new DateTime(Convert.ToInt32(txtYear.Text), Convert.ToInt32(txtMonth.Text), 01); var endDate = startDate.AddDays(DateTime.DaysInMonth(startDate.Year, startDate.Month)).AddDays(-1); var holidayTerms = txtHolidayTerms.Text.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries).ToList(); var ascTerms = txtAscTerms.Text.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries).ToList(); var calendarUtils = new CalendarUtils(holidayTerms, ascTerms); var service = calendarUtils.CreateService(_applicationName); var days = calendarUtils.GenerateDays(startDate, endDate, service); calendarUtils.GenerateCalendar(startDate, days, _holidayColour,_ascColour); button1.Enabled = true; pictureBox1.Visible = false; }