public void SetData(Guid TimeKeeperTableListID, string EmployeeCode, DateTime Date) { DataTable listByShift; HRM_TIMEKEEPER hRMTIMEKEEPER = new HRM_TIMEKEEPER(); this.dt_Shift = hRMTIMEKEEPER.GetListByDate1(EmployeeCode, Date); if (this.dt_Shift.Rows.Count > 1) { this.btShiftBack.Enabled = true; this.btShiftNext.Enabled = true; this.bbiTimekeepingBreak.Enabled = true; this.btnSave.Enabled = true; } else if (this.dt_Shift.Rows.Count != 1) { if (this.dt_Shift.Rows.Count >= 1) { this.m_ShiftIndex = 1; this.m_ShiftTotal = this.dt_Shift.Rows.Count; listByShift = hRMTIMEKEEPER.GetListByShift(TimeKeeperTableListID, EmployeeCode, this.dt_Shift.Rows[this.m_ShiftIndex - 1]["ShiftCode"].ToString(), Date); this.SetData(listByShift); return; } this.btShiftBack.Enabled = false; this.btShiftNext.Enabled = false; this.bbiTimekeepingBreak.Enabled = false; this.btnSave.Enabled = false; this.txtShift.Text = ""; this.dtDate.DateTime = DateTime.Now; this.teTimeIn.EditValue = DateTime.Now; this.teTimeOut.EditValue = DateTime.Now; this.calHour.EditValue = 0; this.calNightHour.EditValue = 0; this.calDayHour.EditValue = 0; this.txtSymbol.Text = ""; this.calLateMinute.EditValue = 0; this.calEarlyMinute.EditValue = ""; this.txtDescription.Text = ""; return; } else { this.btShiftBack.Enabled = false; this.btShiftNext.Enabled = false; this.bbiTimekeepingBreak.Enabled = true; this.btnSave.Enabled = true; } this.m_ShiftIndex = 1; this.m_ShiftTotal = this.dt_Shift.Rows.Count; listByShift = hRMTIMEKEEPER.GetListByShift(TimeKeeperTableListID, EmployeeCode, this.dt_Shift.Rows[this.m_ShiftIndex - 1]["ShiftCode"].ToString(), Date); this.SetData(listByShift); }
private void repPopup_Popup(object sender, EventArgs e) { this.m_EmployeeCode = this.gbList.GetFocusedRowCellValue(this.colEmployeeCode).ToString(); this.m_ShiftCode = this.gbList.GetFocusedRowCellValue(this.colShiftCode).ToString(); HRM_TIMEKEEPER hRMTIMEKEEPER = new HRM_TIMEKEEPER(); DataTable listByShift = hRMTIMEKEEPER.GetListByShift(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date); this.xucTimekeepingAdd.SetData(listByShift); this.xucTimekeepingAdd.Status = Actions.Update; }
private void btShiftBack_Click(object sender, EventArgs e) { HRM_TIMEKEEPER hRMTIMEKEEPER = new HRM_TIMEKEEPER(); if (this.m_ShiftIndex - 1 >= 1) { this.m_ShiftIndex--; } else { this.m_ShiftIndex = this.m_ShiftTotal; } DataTable listByShift = hRMTIMEKEEPER.GetListByShift(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.dt_Shift.Rows[this.m_ShiftIndex - 1]["ShiftCode"].ToString(), this.m_Date); this.SetData(listByShift); }