Пример #1
0
        public ActionResult Create(ReporteModelo repMod)
        {
            ReporteCP     repCP = new ReporteCP();
            ComentarioCEN cen   = new ComentarioCEN();
            EventoCEN     cen2  = new EventoCEN();

            var userName = System.Web.HttpContext.Current.User.Identity.Name;

            repCP.NuevoReporte(repMod.texto, repMod.motivo, userName, repMod.id, repMod.tipo);
            if (repMod.tipo == TipoReporteEnum.foto)
            {
                return(RedirectToAction("Details", "Foto", new { id = repMod.id }));
            }
            if (repMod.tipo == TipoReporteEnum.evento)
            {
                return(RedirectToAction("Details", "Evento", new { id = repMod.id }));
            }
            if (repMod.tipo == TipoReporteEnum.comentario)
            {
                ComentarioEN en = cen.ReadOID(repMod.id);
                if (cen2.ReadOID(en.Evento.Id) != null)
                {
                    return(RedirectToAction("Details", "Evento", new { id = en.Evento.Id }));
                }
                else
                {
                    return(RedirectToAction("Details", "Foto", new { id = en.Foto.Id }));
                }
            }
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Create(ReporteModelo repMod)
 {
     try
     {
         ReporteCP repCP = new ReporteCP();
         repCP.NuevoReporte(repMod.texto, repMod.motivo, repMod.email, repMod.id, repMod.tipo);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }