Exemplo n.º 1
0
        public ActionResult Editar(int Anuncio_ID)
        {
            try { this.AnunciosProxy = new ADESCOMBUSINESS.Areas.Anuncios.Methods.AnunciosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            ADESCOMBUSINESS.Areas.Anuncios.Models.ANU_Anuncios Anuncio = new ADESCOMBUSINESS.Areas.Anuncios.Models.ANU_Anuncios();
            Anuncio = AnunciosProxy.GetByID(Anuncio_ID);

            List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Imagenes> ListaImagenes = new List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Imagenes>();

            ListaImagenes = ADESCOMBUSINESS.Areas.Anuncios.Methods.ImagenesBusiness.GetByAnuncio_ID((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"], Anuncio.Anuncio_ID);

            ADESCOMBUSINESS.Areas.Anuncios.Models.AnuncioCompuesto AnuncioCompuesto = new ADESCOMBUSINESS.Areas.Anuncios.Models.AnuncioCompuesto();
            AnuncioCompuesto.Anuncio  = Anuncio;
            AnuncioCompuesto.Imagenes = ListaImagenes;

            //ViewBags
            ADESCOMBUSINESS.Areas.Residentes.Methods.ResidentesBusiness ResidentesProxy = new ADESCOMBUSINESS.Areas.Residentes.Methods.ResidentesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]);
            ADESCOMBUSINESS.Areas.Residentes.Models.RES_Residentes      Residente       = new ADESCOMBUSINESS.Areas.Residentes.Models.RES_Residentes();
            Residente = ResidentesProxy.GetByID(Anuncio.Residente_ID);

            ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness DireccionProxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]);
            ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Direcciones          Direccion      = new ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Direcciones();
            ViewBag.Direccion = DireccionProxy.GetByID(Residente.Direccion_ID).DIR_Descripcion;

            ViewBag.TipoTrans = new SelectList(GetTipos(), "Option", "Description", Anuncio.ANU_Tipo);
            ViewBag.Categoria = new SelectList(GetCategorias(), "Option", "Description", Anuncio.ANU_Categoria);

            return(View(AnuncioCompuesto));
        }
Exemplo n.º 2
0
        public ActionResult Rechazar(int Anuncio_ID)
        {
            try { this.AnunciosProxy = new ADESCOMBUSINESS.Areas.Anuncios.Methods.AnunciosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJANU_Anuncios = AnunciosProxy.GetByID(Anuncio_ID);

            if (OBJANU_Anuncios == null)
            {
                return(HttpNotFound());
            }

            return(View(OBJANU_Anuncios));
        }