private void InitializeFields() { dtpFocusDate.Value = DateTime.Now; dtpInDate.Value = DateTime.Now; dtpOutDate.Value = DateTime.Now; using (clsShift shift = new clsShift()) { shift.ShiftCode = clsShift.GetDayShiftCode(OfficialBusiness.GetRequestor(_strOBCode), DateTime.Now); shift.Fill(); dtpInTime.Value = shift.TimeStart; dtpOutTime.Value = shift.TimeEnd; } }
private void dtpFocusDate_ValueChanged(object sender, EventArgs e) { try { dtpInDate.Value = dtpFocusDate.Value; dtpOutDate.Value = dtpFocusDate.Value; using (clsShift shift = new clsShift()) { shift.ShiftCode = clsShift.GetDayShiftCode(OfficialBusiness.GetRequestor(_strOBCode), dtpFocusDate.Value); shift.Fill(); dtpInTime.Value = shift.TimeStart; dtpOutTime.Value = shift.TimeEnd; } } catch { } }