private void DisplayHours(DailyWorkDetail[] details) { foreach (var day in details) { bSource.Add(day); } }
/// <summary> /// Method to bind source to DGV /// </summary> /// <param name="data">employee dictionary</param> private void PopulateGrid(DailyWorkDetail[] details) { bSource = new BindingSource(); bSource.DataSource = typeof(DailyWorkDetail); DgvDisplay.DataSource = bSource; DisplayHours(details); }
/// <summary> /// Constructor to take employee dictionary /// </summary> /// <param name="employees">Employees Dictionary</param> public FrmHourTrackerDisplay(DailyWorkDetail[] details) { InitializeComponent(); DgvDisplay.AutoGenerateColumns = true; DgvDisplay.AutoSize = true; DgvDisplay.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGray; PopulateGrid(details); }
/// <summary> /// Method for creating empty Days with accurate dates for any week object. /// </summary> /// <param name="index">integer index representing the day of the week to begin on</param> /// <param name="dateNum">integer date number representing the beginning date of the week</param> private void CreateEmptyDays(int index, int dateNum) { DateTime temp = StartDate; int dayIncrementor = 0; for (int num = index; num < WEEK_SIZE; num++) { if(dateNum > EndDate.Day) { break; } DailyWorkDetailRecords[num] = new DailyWorkDetail(temp, 0, ""); temp = StartDate.AddDays(++dayIncrementor); } }
public void CreateDay() { //arrange int dayNum = 3; double hoursWorked = 8; string workDescription = "Software Development"; //act DailyWorkDetail monday = new DailyWorkDetail(dayNum, WeekDays.Monday, hoursWorked, workDescription); //assert Assert.AreEqual(dayNum, monday.DayNum); Assert.AreEqual(hoursWorked, monday.HoursWorked); Assert.AreEqual(WeekDays.Monday, monday.DayOfTheWeek); Assert.AreEqual(workDescription, monday.WorkDescription); }