예제 #1
0
        public async Task <CandidateTimesheetHoursViewModel> CreateCandidateTimesheetHours(CandidateTimesheetHoursViewModel data)
        {
            try
            {
                tblCandidateTimesheetHour res = await Task.Run(() => ManageCandidateTimesheetHours.InsertCandidateTimesheetHours(data.ConvertTotblCandidateTimesheetHour()));

                return(res.ConvertToCandidateTimesheetHoursViewModel());
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        public async Task <CandidateTimesheetHoursViewModel> GetCandidateTimesheetHours(long Id)
        {
            try
            {
                tblCandidateTimesheetHour res = await Task.Run(() => ManageCandidateTimesheetHours.GetCandidateTimesheetHours(Id));

                return(res.ConvertToCandidateTimesheetHoursViewModel());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
 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
     });
 }