Ejemplo 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
        public ActionResult RechazarConfirmed(ADESCOMBUSINESS.Areas.Anuncios.Models.ANU_Anuncios Registro)
        {
            if (String.IsNullOrEmpty(Registro.ANU_MotivoRechazo))
            {
                ModelState.AddModelError("ANU_MotivoRechazo", "Campo requerido");
            }

            if (ModelState.IsValid)
            {
                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 })); }

                //Rechazar anuncio
                try
                {
                    ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"];
                    bool Status = AnunciosProxy.RechazarAnuncio(Registro, CompanyInfo);
                    if (!Status)
                    {
                        return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                    }
                    ViewBag.Error = "OK";
                }
                catch (Exception ex)
                {
                    ViewBag.Error = ex.Message;
                }
            }

            return(View(Registro));
        }
Ejemplo n.º 4
0
        public ActionResult RefreshDataSearchList(FormCollection Form)
        {
            int searchLL1 = Convert.ToInt32(Form["Llave1_IDFilter"]);
            int searchLL2 = Convert.ToInt32(Form["Llave2_IDFilter"]);
            int searchLL3 = Convert.ToInt32(Form["Llave3_IDFilter"]);
            int Estatus   = Convert.ToInt32(Form["FindEstatus"]);

            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 })); }
            List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Anuncios> Lista = new List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Anuncios>();

            Lista = AnunciosProxy.GetByFilters(searchLL1, searchLL2, searchLL3, Estatus);

            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:
                return(View("RefreshData1", Lista));

            case 2:
                return(View("RefreshData2", Lista));

            case 3:
                return(View("RefreshData3", Lista));
            }

            return(null);
        }
Ejemplo n.º 5
0
        public ActionResult FinalizarConfirmed(ADESCOMBUSINESS.Areas.Anuncios.Models.ANU_Anuncios Registro)
        {
            if (ModelState.IsValid)
            {
                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 })); }

                //Finalizar anuncio
                try
                {
                    bool Status = AnunciosProxy.FinalizarAnuncio(Registro);
                    if (!Status)
                    {
                        return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                    }
                    ViewBag.Error = "OK";
                }
                catch (Exception ex)
                {
                    ViewBag.Error = ex.Message;
                }
            }

            return(View(Registro));
        }
Ejemplo n.º 6
0
        public ActionResult RefreshData()
        {
            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 })); }
            List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Anuncios> Lista = new List <ADESCOMBUSINESS.Areas.Anuncios.Models.VwANU_Anuncios>();

            Lista = AnunciosProxy.GetUnauthorized();
            return(View(Lista));
        }
Ejemplo n.º 7
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));
        }