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

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something Went Wrong!");
                return(View(model));
            }
        }
Пример #2
0
 public bool Delete(CommunicationPhrase entity)
 {
     _db.CommunicationPhrases.Remove(entity);
     return(Save());
 }
Пример #3
0
 public bool Update(CommunicationPhrase entity)
 {
     _db.CommunicationPhrases.Update(entity);
     return(Save());
 }
Пример #4
0
 public bool Create(CommunicationPhrase entity)
 {
     _db.CommunicationPhrases.Add(entity);
     return(Save());
 }