private void ShowDateOnHomePageGroupBoxes() { grbDayOne.Text = _date.ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.Day); grbDayTwo.Text = _date.AddDays(1).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(1).Day); grbDayThree.Text = _date.AddDays(2).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(2).Day); grbDayFour.Text = _date.AddDays(3).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(3).Day); grbDayFive.Text = _date.AddDays(4).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(4).Day); grbDaySix.Text = _date.AddDays(5).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(5).Day); grbDaySeven.Text = _date.AddDays(6).ToString("dddd d") + CalendarUtility.AddDateSuffix(_date.AddDays(6).Day); }
private void GetExistingShoppingListFromFile() { _shoppingListDisplayInstance = new ShoppingListDisplay(CalendarUtility.DateNextSunday(_date)); if (_shoppingListDisplayInstance.ShoppingListObject != null) { txtShopping.Text = _shoppingListDisplayInstance.ShoppingListObject.shoppingList; grbShopping.Text = @"Shopping List For" + CalendarUtility.DateNextSunday(_date).ToString(" d") + CalendarUtility.AddDateSuffix(CalendarUtility.DateNextSunday(_date).Day) + CalendarUtility.DateNextSunday(_date).ToString(" MMMM"); } else { grbShopping.Text = @"Shopping List For" + CalendarUtility.DateNextSunday(_date).ToString(" d") + CalendarUtility.AddDateSuffix(CalendarUtility.DateNextSunday(_date).Day) + CalendarUtility.DateNextSunday(_date).ToString(" MMMM"); } }
public GroupBox AddDayOfTheMonthGroupBoxes(int date, DateTime currentlySelectedDate) { _dayOfTheMonthGroupBox = new GroupBox { Name = "box" + date, Text = date + CalendarUtility.AddDateSuffix(date), BackColor = SystemColors.Control, ForeColor = SystemColors.ControlDarkDark, Font = new Font("Segoe UI", 8.25F), Margin = new Padding(5) }; _dayOfTheMonthGroupBox.Controls.Add(AddDayOfTheMonthLabels(_dayOfTheMonthGroupBox)); _selectedDate = currentlySelectedDate; return(_dayOfTheMonthGroupBox); }
public void AddDayOfMonthGroupBoxes(CalendarDayDisplay calendarDay, DateTime date, DateTime selectedDate, TableLayoutPanel pnlCalendarTable) { int days = CalendarUtility.NumberOfDaysInMonth(selectedDate); int column = CalendarUtility.FirstDayOfMonthDisplay(CalendarUtility.FirstOfMonth(selectedDate)); int row = 0; for (int i = 1; i < (days + 1); i++, column++) { pnlCalendarTable.Controls.Add(calendarDay.AddDayOfTheMonthGroupBoxes(i, selectedDate), column, row); if (column != 8) { continue; } column = 1; row++; } }
private void AttachCalendarPageLabelsAndGroupBoxesToArrays() { _calendarPageLabelArray = new Label[CalendarUtility.NumberOfDaysInMonth(_selectedDate)]; _calendarPageGroupBoxArray = new GroupBox[CalendarUtility.NumberOfDaysInMonth(_selectedDate)]; int i = 0; int j = 0; foreach (GroupBox item in pnlCalendarTable.Controls.OfType <GroupBox>()) { _calendarPageGroupBoxArray[j] = item; j++; foreach (Label label in (item).Controls.OfType <Label>()) { _calendarPageLabelArray[i] = label; i++; } } }
private void NewShoppingList() { _shoppingListDisplayInstance = new ShoppingListDisplay(CalendarUtility.DateNextSunday(_date), txtShopping.Text); }