public void sendBackHours(ref WeeklyHours hours) { hours = empAvail; }
public void setEditHours(WeeklyHours store) { ComboBox[] timeBoxes = new ComboBox[84]; CheckBox[] closed = new CheckBox[7]; int i = 84; int j = 7; /*for (i = 0; i < 7; i++) * { * if (DateTime.Compare(store.fromOne[i], store.toOne[i]) == 0) * { * closed[i] = true; * } * }*/ foreach (Control ctrl in Controls) { if (ctrl.Name.StartsWith("comboBox")) { i--; timeBoxes[i] = (ComboBox)ctrl; } if (ctrl.Name.StartsWith("checkBox")) { j--; closed[j] = (CheckBox)ctrl; if (DateTime.Compare(store.fromOne[j], store.toOne[j]) == 0) { closed[j].Checked = true; } else { closed[j].Checked = false; } } } for (i = 0; i < 56; i += 8) { if (closed[i / 8].Checked == true) { } else { timeBoxes[i].SelectedItem = store.fromOne[i / 8].ToString("hh"); timeBoxes[i + 1].SelectedItem = store.fromOne[i / 8].ToString("mm"); timeBoxes[i + 2].SelectedItem = store.toOne[i / 8].ToString("hh"); timeBoxes[i + 3].SelectedItem = store.toOne[i / 8].ToString("mm"); if (DateTime.Compare(store.fromTwo[i / 8], store.toTwo[i / 8]) == 0) { } else { timeBoxes[i + 4].SelectedItem = store.fromTwo[i / 8].ToString("hh"); timeBoxes[i + 5].SelectedItem = store.fromTwo[i / 8].ToString("mm"); timeBoxes[i + 6].SelectedItem = store.toTwo[i / 8].Hour.ToString("hh"); timeBoxes[i + 7].SelectedItem = store.toTwo[i / 8].Minute.ToString("mm"); } } } for (i = 56; i < 84; i += 4) { if (closed[(i - 56) / 4].Checked == true) { } else { timeBoxes[i].SelectedItem = store.fromOne[(i - 56) / 4].ToString("tt"); timeBoxes[i + 1].SelectedItem = store.toOne[(i - 56) / 4].ToString("tt"); timeBoxes[i + 2].SelectedItem = store.fromTwo[(i - 56) / 4].ToString("tt"); timeBoxes[i + 3].SelectedItem = store.toTwo[(i - 56) / 4].ToString("tt"); } } }