Exemple #1
0
        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));
        }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 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;
     }
 }
Exemple #4
0
 /// <summary>
 /// for test
 /// </summary>
 /// <param name="leaveRequestType"></param>
 /// <param name="mockILeaveRequestType"></param>
 public AddLeaveRequestType(Model.Request.LeaveRequestType leaveRequestType, ILeaveRequestType mockILeaveRequestType) : this(leaveRequestType)
 {
     _LeaveRequestTypeDal = mockILeaveRequestType;
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="leaveRequestType"></param>
 public AddLeaveRequestType(Model.Request.LeaveRequestType leaveRequestType)
 {
     _LeaveRequestType = leaveRequestType;
 }