Exemplo n.º 1
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         GaleriaCEN cen = new GaleriaCEN();
         cen.EliminarGaleria(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 2
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            EventoCEN  cen  = new EventoCEN();
            EventoEN   en   = new EventoEN();
            GaleriaCEN cen2 = new GaleriaCEN();

            en = cen.ReadOID(id);
            if (en.Galeria != null)
            {
                cen2.EliminarGaleria(en.Galeria.Id);
            }
            try
            {
                cen.BorrarEvento(id);
                return(RedirectToAction("../Home/Index"));
            }
            catch
            {
                return(RedirectToAction("Details", new { id = id, var = 1 }));
            }
        }