// 建構子 public WorkAttendanController(WorkAttendancePresentationModel waPresentationModel) { this._workAttendanceModel.SetWAEmplID(waPresentationModel.GetWAEmplID()); this._workAttendanceModel.SetWADate(waPresentationModel.GetWADate()); this._workAttendanceModel.SetWAStatus(waPresentationModel.GetWAStatus()); String waStatus = this._workAttendanceModel.GetWAStatus(); if (!(waStatus == "無故未到" || waStatus == "病假" || waStatus == "婚假" || waStatus == "產假" || waStatus == "休假")) { this._workAttendanceModel.SetStartTime(waPresentationModel.GetStartTime()); this._workAttendanceModel.SetEndTime(waPresentationModel.GetEndTime()); } this._workAttendanceModel.SetIsOvertime(waPresentationModel.GetIsOvertime()); if (this._workAttendanceModel.GetIsOvertime()) { this._workAttendanceModel.SetStartOvertime(waPresentationModel.GetStartOvertime()); this._workAttendanceModel.SetEndOvertime(waPresentationModel.GetEndOvertime()); } }
// 按下搜尋work attendance private void ClickSearchWAButton(object sender, EventArgs e) { String emplID = _editWAEmplIDTB.Text; DateTime date = _editWADateDTP.Value; _waPresentationModel.SetWAEmplID(emplID); _waPresentationModel.SetWADate(date); _waController = new WorkAttendanController(_waPresentationModel); _waPresentationModel = _waController.SearchDataByEmplIDAndDate(); if (_waPresentationModel.GetWAEmplID() == null || _waPresentationModel.GetWAEmplID() == "") return; this.ResetAllEditWAUI(); }