Esempio n. 1
0
 public string DeleteAdvert(string Id)
 {
     try
     {
         MongoDbContext.DeleteAdvert(Id);
         return("Обїявление удалено");
     }
     catch (Exception e)
     {
         return("Ошибка удаления объявления");
     }
 }
Esempio n. 2
0
        public ActionResult Delete(string Id)
        {
            try
            {
                MongoDbContext.DeleteAdvert(Id);

                return(RedirectToAction("Index", new { IsPositive = true, Message = "Объявление удалено" }));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", new { IsPositive = false, Message = "Во время удаления возникли ошибки" }));
            }
        }