Exemplo n.º 1
0
        public ActionResult DeleteGalery(int id)
        {
            var galery = _galeryService.Find(id);

            try
            {
                _galeryService.Delete(galery);
                _uow.SaveChanges();

                messagesForView.Clear();
                messagesForView.Add("İşlemi başarılı!");
                Success(messagesForView);
            }
            catch (Exception ex)
            {
                messagesForView.Clear();
                messagesForView.Add("İşlem başarısız!");
                messagesForView.Add(ex.Message);
                messagesForView.Add(ex.InnerException.Message);
                Error(messagesForView);
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult DeleteConfirmed(int?id)
 {
     service.Delete(id);
     return(RedirectToAction("AllPictures"));
 }
Exemplo n.º 3
0
 public ActionResult Delete(Guid id)
 {
     galeryService.Delete(id);
     return(RedirectToAction("Index"));
 }