public void CompleteTheObject(ref Model.Request.LeaveRequestType theObjectToComplete) { int leaveRequestTypeID = string.IsNullOrEmpty(_ItsView.LeaveRequestTypeID) ? 0 : Convert.ToInt32(_ItsView.LeaveRequestTypeID); theObjectToComplete = new Model.Request.LeaveRequestType (leaveRequestTypeID, _ItsView.LeaveRequestTypeName, _ItsView.LeaveRequestTypeDescription, _ItsView.IncludeLegalHoliday, _ItsView.IncludeRestDay, Convert.ToDecimal(_ItsView.LeastHour)); }
public void DataBind(string leaveRequestTypeId) { Model.Request.LeaveRequestType theDataToBind = _LeaveRequestTypeBll.GetLeaveRequestTypeByPkid(Convert.ToInt32(leaveRequestTypeId)); if (theDataToBind != null) { _ItsView.LeaveRequestTypeID = theDataToBind.LeaveRequestTypeID.ToString(); _ItsView.LeaveRequestTypeName = theDataToBind.Name; _ItsView.LeaveRequestTypeDescription = theDataToBind.Description; _ItsView.IncludeLegalHoliday = theDataToBind.IncludeLegalHoliday; _ItsView.IncludeRestDay = theDataToBind.IncludeRestDay; _ItsView.LeastHour = theDataToBind.LeastHour.ToString(); } }
public void UpdateEvent() { //数据验证过程 if (!new LeaveRequestTypeVaildater(_ItsView).Vaildate()) { return; } //数据收集过程 Model.Request.LeaveRequestType theObject = _LeaveRequestTypeBll.GetLeaveRequestTypeByPkid(Convert.ToInt32(_ItsView.LeaveRequestTypeID)); new LeaveRequestTypeDataCollector(_ItsView).CompleteTheObject(ref theObject); try { _LeaveRequestTypeBll.UpdateLeaveRequestType(theObject); _ItsView.ActionSuccess = true; } catch (ApplicationException ae) { _ItsView.Message = ae.Message; } }
/// <summary> /// for test /// </summary> /// <param name="leaveRequestType"></param> /// <param name="mockILeaveRequestType"></param> public AddLeaveRequestType(Model.Request.LeaveRequestType leaveRequestType, ILeaveRequestType mockILeaveRequestType) : this(leaveRequestType) { _LeaveRequestTypeDal = mockILeaveRequestType; }
/// <summary> /// /// </summary> /// <param name="leaveRequestType"></param> public AddLeaveRequestType(Model.Request.LeaveRequestType leaveRequestType) { _LeaveRequestType = leaveRequestType; }