Ejemplo n.º 1
0
        public ActionResult Editar(int Noticia_ID)
        {
            try { this.NoticiasProxy = new ADESCOMBUSINESS.Areas.Noticias.Methods.NoticiasBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }

            OBJNEW_Noticias = new ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Noticias();
            OBJNEW_Noticias = NoticiasProxy.GetByID(Noticia_ID);

            List <ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Imagenes> ListaImagenes = new List <ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Imagenes>();

            ListaImagenes = ADESCOMBUSINESS.Areas.Noticias.Methods.ImagenesBusiness.GetByNoticia_ID((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"], Noticia_ID);

            if (ListaImagenes.Count > 0)
            {
                ViewBag.Imagen1 = ListaImagenes[0].IMG_URL;
                if (ListaImagenes.Count > 1)
                {
                    ViewBag.Imagen2 = ListaImagenes[1].IMG_URL;
                }
                if (ListaImagenes.Count > 2)
                {
                    ViewBag.Imagen3 = ListaImagenes[2].IMG_URL;
                }
                if (ListaImagenes.Count > 3)
                {
                    ViewBag.Imagen4 = ListaImagenes[3].IMG_URL;
                }
                if (ListaImagenes.Count > 4)
                {
                    ViewBag.Imagen5 = ListaImagenes[4].IMG_URL;
                }
            }
            return(View(OBJNEW_Noticias));
        }
Ejemplo n.º 2
0
        public ActionResult Detalle(int Noticia_ID)
        {
            try { this.NoticiasProxy = new ADESCOMBUSINESS.Areas.Noticias.Methods.NoticiasBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }

            OBJNEW_Noticias = new ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Noticias();
            OBJNEW_Noticias = NoticiasProxy.GetByID(Noticia_ID);

            List <ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Imagenes> ListaImagenes = new List <ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Imagenes>();

            ListaImagenes = ADESCOMBUSINESS.Areas.Noticias.Methods.ImagenesBusiness.GetByNoticia_ID((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"], Noticia_ID);

            ADESCOMBUSINESS.Areas.Noticias.Models.NoticiaCompuesta NoticiaCompuesta = new ADESCOMBUSINESS.Areas.Noticias.Models.NoticiaCompuesta();
            NoticiaCompuesta.Noticia  = OBJNEW_Noticias;
            NoticiaCompuesta.Imagenes = new List <ADESCOMBUSINESS.Areas.Noticias.Models.NEW_Imagenes>();
            NoticiaCompuesta.Imagenes = ListaImagenes;
            return(View(NoticiaCompuesta));
        }