コード例 #1
0
        public AnnualLeaveRequestCRUDModel Create(AnnualLeaveRequestCRUDModel model)
        {
            var annnualLeaveRequestOverviewModel = new AnnualLeaveRequestOverviewModel()
            {
                Year          = model.Year,
                PaidLeaveType = model.PaidLeaveType,
                LeaveType     = model.LeaveType,
                StartDate     = model.StartDate,
                ReturnDate    = model.ReturnDate,
                Notes         = model.Notes,
            };

            var newAnnnualLeaveRequestOverviewModel = _annualLeaveRequestDataAccess.Create(annnualLeaveRequestOverviewModel);

            return(new AnnualLeaveRequestCRUDModel()
            {
                AnnualLeaveRequestID = newAnnnualLeaveRequestOverviewModel.AnnualLeaveRequestID,
                Year = newAnnnualLeaveRequestOverviewModel.Year,
                PaidLeaveType = newAnnnualLeaveRequestOverviewModel.PaidLeaveType,
                LeaveType = newAnnnualLeaveRequestOverviewModel.LeaveType,
                StartDate = newAnnnualLeaveRequestOverviewModel.StartDate,
                ReturnDate = newAnnnualLeaveRequestOverviewModel.ReturnDate,
                Notes = newAnnnualLeaveRequestOverviewModel.Notes,
                ErrorMessage = newAnnnualLeaveRequestOverviewModel.ErrorMessage,
            });
        }
コード例 #2
0
 public AnnualLeaveRequestOverviewModel Create(AnnualLeaveRequestOverviewModel model)
 {
     return(_annualLeaveRequestDataAccess.Create(model));
 }