Ejemplo n.º 1
0
        public async Task <CandidateTimesheetCategoriesHoursViewModel> CreateCandidateTimesheetCategoriesHours(CandidateTimesheetCategoriesHoursViewModel data)
        {
            try
            {
                tblCandidateTimesheetCategoriesHour res = await Task.Run(() => ManageCandidateTimesheetCategoriesHours.InsertCandidateTimesheetCategoriesHours(data.ConvertTotblCandidateTimesheetCategoriesHour()));

                return(res.ConvertToCandidateTimesheetCategoriesHoursViewModel());
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public async Task <CandidateTimesheetCategoriesHoursViewModel> GetCandidateTimesheetCategoriesHours(long Id)
        {
            try
            {
                tblCandidateTimesheetCategoriesHour res = await Task.Run(() => ManageCandidateTimesheetCategoriesHours.GetCandidateTimesheetCategoriesHours(Id));

                return(res.ConvertToCandidateTimesheetCategoriesHoursViewModel());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
 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
     });
 }