Esempio n. 1
0
        public ActionResult Edit(EmployeeTaskRating model)
        {
            try
            {
                // TODO: Add update logic here
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }
                var EmployeeTaskRating = _mapper.Map <EmployeeTaskRating>(model);
                var isSuccess          = _repo.Update(EmployeeTaskRating);
                if (!isSuccess)
                {
                    ModelState.AddModelError("", "Something Went Wrong!");
                    return(View(model));
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something Went Wrong!");
                return(View(model));
            }
        }
Esempio n. 2
0
 public bool Delete(EmployeeTaskRating entity)
 {
     _db.EmployeeTaskRatings.Remove(entity);
     return(Save());
 }
Esempio n. 3
0
 public bool Update(EmployeeTaskRating entity)
 {
     _db.EmployeeTaskRatings.Update(entity);
     return(Save());
 }
Esempio n. 4
0
 public bool Create(EmployeeTaskRating entity)
 {
     _db.EmployeeTaskRatings.Add(entity);
     return(Save());
 }