Пример #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));
        }
Пример #2
0
        public ActionResult Editar(ADESCOMBUSINESS.Areas.Anuncios.Models.AnuncioCompuesto Registro)
        {
            ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"];

            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 })); }

            //Autorizar Anuncio
            try
            {
                AnunciosProxy.AutorizarAnuncio(Registro.Anuncio, CompanyInfo);
                ViewBag.Error = "OK";
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }

            //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(Registro.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", Registro.Anuncio.ANU_Tipo);
            ViewBag.Categoria = new SelectList(GetCategorias(), "Option", "Description", Registro.Anuncio.ANU_Categoria);

            return(View(Registro));
        }
Пример #3
0
        public ActionResult Editar(int Residente_ID)
        {
            try { this.ResidentesProxy = new ADESCOMBUSINESS.Areas.Residentes.Methods.ResidentesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJRES_Residentes = ResidentesProxy.GetByID(Residente_ID);

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

            ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Direcciones          Direccion        = new ADESCOMBUSINESS.Areas.Configuracion.Models.TVI_Direcciones();
            ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness DireccionesProxy = new ADESCOMBUSINESS.Areas.Configuracion.Methods.TVI_DireccionesBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]);
            Direccion = DireccionesProxy.GetByID(OBJRES_Residentes.Direccion_ID);

            ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"];

            int cantLlaves = CompanyInfo.CantLlaves;

            ViewBag.DescLlave1 = CompanyInfo.LabelLlave1;
            ViewBag.DescLlave2 = CompanyInfo.LabelLlave2;
            ViewBag.DescLlave3 = CompanyInfo.LabelLlave3;

            switch (cantLlaves)
            {
            case 1:
                ViewBag.Llave1_ID = new SelectList(GetLlave1(0, "Elija una opción"), "Llave1_ID", "LL1_Descripcion", Direccion.Llave1_ID);
                return(View("Editar1", OBJRES_Residentes));

            case 2:
                ViewBag.Llave1_ID = new SelectList(GetLlave1(0, "Elija una opción"), "Llave1_ID", "LL1_Descripcion", Direccion.Llave1_ID);
                ViewBag.Llave2_ID = new SelectList(GetLlave2(Direccion.Llave1_ID, "Elija una opción"), "Llave2_ID", "LL2_Descripcion", Direccion.Llave2_ID);
                return(View("Editar2", OBJRES_Residentes));

            case 3:
                ViewBag.Llave1_ID = new SelectList(GetLlave1(0, "Elija una opción"), "Llave1_ID", "LL1_Descripcion", Direccion.Llave1_ID);
                ViewBag.Llave2_ID = new SelectList(GetLlave2(Direccion.Llave1_ID, "Elija una opción"), "Llave2_ID", "LL2_Descripcion", Direccion.Llave2_ID);
                ViewBag.Llave3_ID = new SelectList(GetLlave3(Direccion.Llave1_ID, Direccion.Llave2_ID, "Elija una opción"), "Llave3_ID", "LL3_Descripcion", Direccion.Llave3_ID);
                return(View("Editar3", OBJRES_Residentes));
            }

            return(null);
        }