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

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something Went Wrong!");
                return(View(model));
            }
        }
 public bool Delete(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Remove(entity);
     return(Save());
 }
 public bool Update(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Update(entity);
     return(Save());
 }
 public bool Create(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Add(entity);
     return(Save());
 }