private EntityData BuildPassData(string LeaveFlagValue) { EntityData leaveByCode = LeaveDAO.GetLeaveByCode(this._LeaveCode); leaveByCode.CurrentRow["LeaveFlag"] = LeaveFlagValue; return(leaveByCode); }
public void LeaveSubmit() { if (this._dao == null) { LeaveDAO.SubmitAllLeave(this.BuildData()); } else { this.dao.EntityName = "Leave"; this.dao.SubmitEntity(this.BuildData()); } }
public void LeavePass() { if (this._dao == null) { LeaveDAO.UpdateLeave(this.BuildPassData("1")); } else { this.dao.EntityName = "Leave"; this.dao.UpdateEntity(this.BuildPassData("1")); } }
public void LeaveDelete() { if (this._dao == null) { LeaveDAO.DeleteLeave(this.BuildData()); } else { this.dao.EntityName = "Leave"; this.dao.DeleteEntity(this.BuildData()); } }
private void _GetLeaveByCode() { EntityData leaveByCode = LeaveDAO.GetLeaveByCode(this._LeaveCode); this._LeavePerson = leaveByCode.GetString("LeavePerson"); this._LeaveUnit = leaveByCode.GetString("LeaveUnit"); this._LeaveCause = leaveByCode.GetString("LeaveCause"); this._LeaveTime = leaveByCode.GetDateTimeOnlyDate("LeaveTime").ToString(); this._LeaveStartTime = leaveByCode.GetDateTime("LeaveStartTime").ToString(); this._LeaveEndTime = leaveByCode.GetDateTime("LeaveEndTime").ToString(); this._LeaveFlag = leaveByCode.GetString("LeaveFlag"); this._LeaveType = leaveByCode.GetString("LeaveType"); this._LeaveSumTime = leaveByCode.GetDecimalString("LeaveSumTime"); leaveByCode.Dispose(); }
private EntityData BuildData() { EntityData leaveByCode; DataRow newRecord; bool flag = false; if (this._LeaveCode == "") { flag = true; leaveByCode = LeaveDAO.GetLeaveByCode(""); this._LeaveCode = SystemManageDAO.GetNewSysCode("Leave"); newRecord = leaveByCode.GetNewRecord(); } else { leaveByCode = LeaveDAO.GetLeaveByCode(this._LeaveCode); newRecord = leaveByCode.CurrentRow; } if (this._LeaveCode != null) { newRecord["LeaveCode"] = this._LeaveCode; } if (this._LeavePerson != null) { newRecord["LeavePerson"] = this._LeavePerson; } if (this._LeaveUnit != null) { newRecord["LeaveUnit"] = this._LeaveUnit; } if (this._LeaveCause != null) { newRecord["LeaveCause"] = this._LeaveCause; } if (this._LeaveTime != null) { newRecord["LeaveTime"] = this._LeaveTime; } if (this._LeaveStartTime != null) { newRecord["LeaveStartTime"] = this._LeaveStartTime; } if (this._LeaveEndTime != null) { newRecord["LeaveEndTime"] = this._LeaveEndTime; } if (this._LeaveFlag != null) { newRecord["LeaveFlag"] = this._LeaveFlag; } if (this._LeaveType != null) { newRecord["LeaveType"] = this._LeaveType; } if (this._LeaveSumTime != null) { newRecord["LeaveSumTime"] = this._LeaveSumTime; } if (flag) { leaveByCode.AddNewRecord(newRecord); } return(leaveByCode); }