Beispiel #1
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));
        }
Beispiel #2
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));
        }
Beispiel #3
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));
        }
Beispiel #4
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));
        }
Beispiel #5
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));
        }