public async Task <CandidateTimesheetCategoriesHoursViewModel> CreateCandidateTimesheetCategoriesHours(CandidateTimesheetCategoriesHoursViewModel data) { try { tblCandidateTimesheetCategoriesHour res = await Task.Run(() => ManageCandidateTimesheetCategoriesHours.InsertCandidateTimesheetCategoriesHours(data.ConvertTotblCandidateTimesheetCategoriesHour())); return(res.ConvertToCandidateTimesheetCategoriesHoursViewModel()); } catch (Exception) { throw; } }
public async Task <CandidateTimesheetCategoriesHoursViewModel> GetCandidateTimesheetCategoriesHours(long Id) { try { tblCandidateTimesheetCategoriesHour res = await Task.Run(() => ManageCandidateTimesheetCategoriesHours.GetCandidateTimesheetCategoriesHours(Id)); return(res.ConvertToCandidateTimesheetCategoriesHoursViewModel()); } catch (Exception ex) { throw; } }
internal static async Task UpdateCandidateTimesheetCategoriesHours(tblCandidateTimesheetCategoriesHour model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblCandidateTimesheetCategoriesHour> InsertCandidateTimesheetCategoriesHours(tblCandidateTimesheetCategoriesHour model) { try { using (db = new eMSPEntities()) { var candidateTimesheetCategoriesHours = db.tblCandidateTimesheetCategoriesHours.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(candidateTimesheetCategoriesHours); } } catch (Exception) { throw; } }
public static CandidateTimesheetCategoriesHoursViewModel ConvertToCandidateTimesheetCategoriesHoursViewModel(this tblCandidateTimesheetCategoriesHour data) { return(new CandidateTimesheetCategoriesHoursViewModel() { ID = Convert.ToInt64(data.ID), TimesheetID = data.TimesheetID, TimesheetCategoryID = data.TimesheetCategoryID, TimeDate = data.TimeDate, Hours = data.Hours }); }