public async Task <CandidateTimesheetHoursViewModel> CreateCandidateTimesheetHours(CandidateTimesheetHoursViewModel data) { try { tblCandidateTimesheetHour res = await Task.Run(() => ManageCandidateTimesheetHours.InsertCandidateTimesheetHours(data.ConvertTotblCandidateTimesheetHour())); return(res.ConvertToCandidateTimesheetHoursViewModel()); } catch (Exception) { throw; } }
public async Task <CandidateTimesheetHoursViewModel> GetCandidateTimesheetHours(long Id) { try { tblCandidateTimesheetHour res = await Task.Run(() => ManageCandidateTimesheetHours.GetCandidateTimesheetHours(Id)); return(res.ConvertToCandidateTimesheetHoursViewModel()); } catch (Exception ex) { throw; } }
internal static async Task UpdateCandidateTimesheetHours(tblCandidateTimesheetHour 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 <tblCandidateTimesheetHour> InsertCandidateTimesheetHours(tblCandidateTimesheetHour model) { try { using (db = new eMSPEntities()) { var candidateTimesheetHours = db.tblCandidateTimesheetHours.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(candidateTimesheetHours); } } catch (Exception) { throw; } }
public static CandidateTimesheetHoursViewModel ConvertToCandidateTimesheetHoursViewModel(this tblCandidateTimesheetHour data) { return(new CandidateTimesheetHoursViewModel() { ID = Convert.ToInt64(data.ID), TimesheetID = data.TimesheetID, TimeDate = data.TimeDate, HoursWorked = data.HoursWorked, BreakHours = data.BreakHours }); }