예제 #1
0
        public async Task <CandidateTimesheetViewModel> CreateCandidateTimesheet(CandidateTimesheetViewModel data)
        {
            try
            {
                tblCandidateTimesheet res = await Task.Run(() => ManageCandidateTimesheets.InsertCandidateTimesheet(data.ConvertTotblCandidateTimesheet()));

                return(res.ConvertToCandidateTimesheetViewModel());
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        public async Task <CandidateTimesheetViewModel> UpdateCandidateTimesheet(CandidateTimesheetViewModel data)
        {
            try
            {
                await Task.Run(() => ManageCandidateTimesheets.UpdateCandidateTimesheet(data.ConvertTotblCandidateTimesheet()));

                return(data);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #3
0
        public async Task <IHttpActionResult> UpdateTimeSheet(CandidateTimesheetViewModel model)
        {
            try
            {
                userId = User.Identity.GetUserId();
                Helpers.Helpers.AddBaseProperties(model, "update", userId);

                return(Ok(await CandidateManager.UpdateCandidateTimesheet(model)));
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #4
0
 public static tblCandidateTimesheet ConvertTotblCandidateTimesheet(this CandidateTimesheetViewModel data)
 {
     return(new tblCandidateTimesheet()
     {
         ID = Convert.ToInt64(data.ID),
         PayPeriodID = data.PayPeriodID,
         PlacementID = data.PlacementID,
         StatusID = data.StatusID,
         VersionNumber = data.VersionNumber,
         IsActive = data.isActive,
         IsDeleted = data.isDeleted ?? false,
         CreatedUserID = data.createdUserID,
         UpdatedUserID = data.updatedUserID,
         CreatedTimestamp = data.createdTimestamp ?? DateTime.Now,
         UpdatedTimestamp = data.updatedTimestamp,
         tblCandidateTimesheetHours = data.CandidateTimesheetHours.Select(x => x?.ConvertTotblCandidateTimesheetHour()).ToList(),
         tblCandidateTimesheetCategoriesHours = data.CandidateTimesheetCategoriesHours.Select(x => x?.ConvertTotblCandidateTimesheetCategoriesHour()).ToList()
     });
 }