public ActionResult RefreshFecha(FormCollection form)
        {
            int Mes  = DateTime.Now.Month;
            int Anio = DateTime.Now.Year;

            if (!string.IsNullOrEmpty(form["Mes"]))
            {
                Mes = Convert.ToInt32(form["Mes"]);
            }

            if (!string.IsNullOrEmpty(form["Anio"]))
            {
                Anio = Convert.ToInt32(form["Anio"]);
            }

            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos> Lista = new List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos>();
            DateTime Inicio = DateTime.Parse(Anio + "/" + Mes + "/01");
            DateTime Fin    = DateTime.Parse(Anio + "/" + Mes + "/" + DateTime.DaysInMonth(Anio, Mes));

            Lista = EventosProxy.GetByDateResidente(Inicio, Fin);

            return(View("RefreshData", Lista));
        }
Esempio n. 2
0
        public ActionResult Editar(ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos Registro)
        {
            ADESCOMBUSINESS.DataAccess.Models.CompanyInfo CompanyInfo = (ADESCOMBUSINESS.DataAccess.Models.CompanyInfo)Session["CompanyInfo"];

            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJEVE_Eventos = EventosProxy.GetByID(Registro.Evento_ID);

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

            //Autorizar Residente
            try
            {
                EventosProxy.AutorizarReservacion(OBJEVE_Eventos, CompanyInfo);
                ViewBag.Error = "OK";
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }

            ViewBag.Fecha       = Registro.EVE_Fecha.ToString("dd/MMM/yyyy");
            ViewBag.Instalacion = Registro.INS_Descripcion;

            return(View(Registro));
        }
Esempio n. 3
0
        public ActionResult RechazarConfirmed(ADESCOMBUSINESS.Areas.Eventos.Models.EVE_Eventos Registro)
        {
            if (String.IsNullOrEmpty(Registro.EVE_MotivoRechazo))
            {
                ModelState.AddModelError("EVE_MotivoRechazo", "Campo requerido");
            }

            if (ModelState.IsValid)
            {
                try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
                catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }

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

            return(View(Registro));
        }
Esempio n. 4
0
        public ActionResult RefreshData()
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos> Lista = new List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos>();

            Lista = EventosProxy.GetUnauthorized();
            return(View(Lista));
        }
Esempio n. 5
0
        public ActionResult Rechazar(int Evento_ID)
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJEVE_Eventos = EventosProxy.GetByID(Evento_ID);

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

            return(View(OBJEVE_Eventos));
        }
        public ActionResult Index()
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos> Lista = new List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos>();
            DateTime Inicio = DateTime.Parse(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/01");
            DateTime Fin    = DateTime.Parse(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month));

            Lista        = EventosProxy.GetByDateResidente(Inicio, Fin);
            ViewBag.Mes  = new SelectList(GetMeses(), "Option", "Description", DateTime.Now.Month);
            ViewBag.Anio = new SelectList(GetAnios(), "Option", "Description", DateTime.Now.Year);

            return(View(Lista));
        }
Esempio n. 7
0
        public ActionResult GetEventosDelDia(DateTime Fecha, int Instalacion_ID, int Evento_ID)
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos> Lista = new List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos>();

            try
            {
                Lista = EventosProxy.GetByDateLocation(Fecha, Instalacion_ID, Evento_ID);
            }
            catch (Exception ex)
            {
            }

            return(View(Lista));
        }
Esempio n. 8
0
        public ActionResult Editar(int Evento_ID)
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); } catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos VwEvento = new ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos();
            VwEvento = EventosProxy.GetViewByID(Evento_ID);

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

            ViewBag.Fecha       = VwEvento.EVE_Fecha.ToString("dd/MMM/yyyy");
            ViewBag.Instalacion = VwEvento.INS_Descripcion;

            return(View(VwEvento));
        }
Esempio n. 9
0
        public ActionResult Editar(int Evento_ID)
        {
            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }
            OBJEVE_Eventos = EventosProxy.GetByID(Evento_ID);

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

            ViewBag.Instalacion_ID = new SelectList(GetInstalaciones(OBJEVE_Eventos.Instalacion_ID), "Instalacion_ID", "INS_Descripcion", OBJEVE_Eventos.Instalacion_ID);
            String Inicio = OBJEVE_Eventos.EVE_Inicio.ToString();

            ViewBag.Inicio = new SelectList(GetHorarios(), "Option", "Description", Inicio.Substring(0, 5));
            String Fin = OBJEVE_Eventos.EVE_Fin.ToString();

            ViewBag.Fin = new SelectList(GetHorarios(), "Option", "Description", Fin.Substring(0, 5));
            return(View(OBJEVE_Eventos));
        }
        public JsonResult GetEventosDelMes(int mes, int anio)
        {
            this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]);
            List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos> Lista = new List <ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos>();
            DateTime Inicio = DateTime.Parse(anio + "/" + mes + "/01");
            DateTime Fin    = DateTime.Parse(anio + "/" + mes + "/" + DateTime.DaysInMonth(anio, mes));

            Lista = EventosProxy.GetByDateResidente(Inicio, Fin);

            List <EventoJson> ListaRet = new List <EventoJson>();

            foreach (ADESCOMBUSINESS.Areas.Eventos.Models.VwEVE_Eventos evento in Lista)
            {
                ListaRet.Add(new EventoJson()
                {
                    title = evento.DIR_Descripcion + " - " + evento.INS_Descripcion + " (" + evento.EVE_Inicio.ToString() + " - " + evento.EVE_Fin.ToString() + ")", start = evento.EVE_Fecha.ToString("yyyy-MM-dd HH:mm"), allDay = "false"
                });
            }

            return(Json(ListaRet, JsonRequestBehavior.AllowGet));
        }
Esempio n. 11
0
        public ActionResult Editar(FormCollection Form)
        {
            ADESCOMBUSINESS.Areas.Eventos.Models.EVE_Eventos Registro = new ADESCOMBUSINESS.Areas.Eventos.Models.EVE_Eventos();

            try { this.EventosProxy = new ADESCOMBUSINESS.Areas.Eventos.Methods.EventosBusiness((ADESCOMBUSINESS.DataAccess.Models.LoginRS)Session["InfoUser"]); }
            catch (Exception ex) { return(RedirectToAction("SesionExpired", "Inicio", new { Area = "", Mensaje = ex.Message })); }

            if (String.IsNullOrEmpty(Form["Instalacion_ID"]) || Form["Instalacion_ID"] == "0")
            {
                ModelState.AddModelError("Instalacion_ID", "Campo Requerido");
            }
            else
            {
                try { Registro.Instalacion_ID = Convert.ToInt32(Form["Instalacion_ID"]); } catch { ModelState.AddModelError("Instalacion_ID", "Formato Incorrecto"); }
            }

            try
            {
                TimeSpan ts = TimeSpan.Parse(Form["Inicio"].ToString());
                Registro.EVE_Inicio = ts;
            }
            catch
            {
                ModelState.AddModelError("EVE_Inicio", "Formato Incorrecto");
            }

            try
            {
                TimeSpan ts = TimeSpan.Parse(Form["Fin"].ToString());
                Registro.EVE_Fin = ts;
            }
            catch
            {
                ModelState.AddModelError("EVE_Fin", "Formato Incorrecto");
            }

            try
            {
                Registro.EVE_Fecha = Convert.ToDateTime(Form["EVE_Fecha"]);
            }
            catch
            {
                ModelState.AddModelError("EVE_Fecha", "Formato Incorrecto");
            }

            Registro.Evento_ID       = Convert.ToInt32(Form["Evento_ID"]);
            Registro.EVE_Tipo        = "MES";
            Registro.EVE_Titulo      = Form["EVE_Titulo"];
            Registro.EVE_Detalles    = Form["EVE_Detalles"];
            Registro.EVE_Organizador = Form["EVE_Organizador"];

            if (ModelState.IsValid)
            {
                try
                {
                    bool Status = EventosProxy.Editar(Registro);
                    if (!Status)
                    {
                        return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                    }
                    ViewBag.Error = "OK";
                }
                catch (Exception ex)
                {
                    ViewBag.Error = ex.Message;
                }
            }

            ViewBag.Instalacion_ID = new SelectList(GetInstalaciones(OBJEVE_Eventos.Instalacion_ID), "Instalacion_ID", "INS_Descripcion", Registro.Instalacion_ID);

            ViewBag.Instalacion_ID = new SelectList(GetInstalaciones(OBJEVE_Eventos.Instalacion_ID), "Instalacion_ID", "INS_Descripcion", Registro.Instalacion_ID);
            String Inicio = Registro.EVE_Inicio.ToString();

            ViewBag.Inicio = new SelectList(GetHorarios(), "Option", "Description", Inicio.Substring(0, 5));
            String Fin = Registro.EVE_Fin.ToString();

            ViewBag.Fin = new SelectList(GetHorarios(), "Option", "Description", Fin.Substring(0, 5));

            return(View(Registro));
        }