Ejemplo n.º 1
0
        public IActionResult Delete([FromBody] Evento evento)
        {
            EventoBLL eventoBLL = new EventoBLL();

            eventoBLL.Delete(evento);
            return(NoContent());
        }
Ejemplo n.º 2
0
        protected void btn_CriarEvento_Click(object sender, EventArgs e)
        {
            try
            {
                Evento  evento  = new Evento();
                Usuario usuario = (Usuario)Session["Usuario"];

                evento.Titulo        = txtTitulo.Text;
                evento.DataEvento    = DateTime.Parse(txtData.Text);
                evento.Descricao     = txtDesc.Text;
                evento.mStatusEvento = 1;
                evento.mTipoEvento   = int.Parse(cbxTipoEvento.SelectedValue);
                evento.mUsuario      = usuario.Usuario_ID;
                evento.DataCriacao   = DateTime.Now;
                evento.Estado        = txtEstado.Text;
                evento.Bairro        = txtBairro.Text;
                evento.Rua           = txtLogradouro.Text;
                evento.CEP           = txtCEP.Text;
                evento.Cidade        = txtCidade.Text;
                evento.Complemento   = txtComplemento.Text;
                evento.Numero        = int.Parse(txtNumero.Text);

                EventoBLL.InserirEvento(evento);
                Response.Redirect("~/Views/Index/Index.aspx", false);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// Carga la grilla con todos los eventos registrados
            /// </summary>
            if (!IsPostBack)
            {
                EventoBLL evBLL = new EventoBLL();
                //UsuarioBEL usuario = new UsuarioBEL();
                UsuarioBEL usuario = (UsuarioBEL)Session["usuarioConectado"];
                grvEventos.DataSource = evBLL.traerEventos(usuario.Rut);
                grvEventos.DataBind();

                RecintoBLL recBLL = new RecintoBLL();
                ddlRecintos.DataSource     = recBLL.traerRecintos();
                ddlRecintos.DataValueField = "IdRecinto";
                ddlRecintos.DataTextField  = "NombreRecinto";
                ddlRecintos.DataBind();
                ddlRecintos.Items.Insert(0, new ListItem("..Seleccione Recinto..", "-1"));

                TipoEventoBLL tipBLL = new TipoEventoBLL();
                ddlTipoEventos.DataSource     = tipBLL.listaDeTiposEventos();
                ddlTipoEventos.DataValueField = "IdTipoEvento";
                ddlTipoEventos.DataTextField  = "DescripcionTipoEvento";
                ddlTipoEventos.DataBind();
                ddlTipoEventos.Items.Insert(0, new ListItem("..Seleccione Tipo Evento..", "-1"));
            }
        }
Ejemplo n.º 4
0
        public IActionResult Put([FromBody] Evento evento)
        {
            EventoBLL eventoBLL = new EventoBLL();

            eventoBLL.Put(evento);
            return(Json(evento));
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// Carga la grilla con las ventas del evento seleccionado en el select
            /// </summary>
            if (!IsPostBack)
            {
                PerfilBEL usuario   = (PerfilBEL)Session["usuarioConectado"];
                EventoBLL eventoBLL = new EventoBLL();
                int       rut;
                if (usuario.Usuario.IndexOf('-') != -1)
                {
                    String[] separadorRut = usuario.Usuario.Split('-');
                    rut = Int32.Parse(separadorRut[0]);
                }
                else
                {
                    rut = Int32.Parse(usuario.Usuario);
                }

                ClienteTicketBLL bllClienteTicket = new ClienteTicketBLL();
                grvContrato.DataSource = bllClienteTicket.traerClienteTicketOrg(rut);
                grvContrato.DataBind();

                ddlEvento.DataSource     = eventoBLL.traerEventos(rut);
                ddlEvento.DataTextField  = "Nombre";
                ddlEvento.DataValueField = "IdEvento";
                ddlEvento.DataBind();
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);

                if (id > 0)
                {
                    EventoBLL  bll    = new EventoBLL();
                    EventoType evento = bll.selectRecord(id);

                    if (evento.idEvento > 0 && evento.idAssociacao == Int32.Parse(Session["AssociacaoID"].ToString()))
                    {
                        bll.delete(evento);
                        Session["FlashMsg"]     = "Apagado com sucesso";
                        Session["FlashMsgType"] = "success";
                    }
                    else
                    {
                        throw new Exception("Id invalido");
                    }
                }
            }
            catch (Exception ex)
            {
                Session["FlashMsg"]     = ex.Message;
                Session["FlashMsgType"] = "danger";
            }

            Response.Redirect("~/Painel/Eventos.aspx");
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Filtra los eventos por id o nombre segun el checkbox seleccionado
        /// </summary>
        protected void btnBusqueda_Click1(object sender, EventArgs e)
        {
            EventoBLL evBLL   = new EventoBLL();
            PerfilBEL usuario = (PerfilBEL)Session["usuarioConectado"];

            String[] separadorRut = usuario.Usuario.Split('-');
            if (txtBusqueda.Text == "")
            {
                return;
            }
            if (Id_evento.Checked)
            {
                try
                {
                    grvEventos.DataSource = evBLL.traerEventosPorBusqueda(Int32.Parse(txtBusqueda.Text), Int32.Parse(separadorRut[0]));
                    grvEventos.DataBind();
                }
                catch
                {
                    Response.Write("<script>alert('Código solo números'); </script>");
                }
            }
            if (Nombre.Checked)
            {
                grvEventos.DataSource = evBLL.traerEventosPorBusqueda(txtBusqueda.Text, Int32.Parse(separadorRut[0]));
                grvEventos.DataBind();
            }
        }
Ejemplo n.º 8
0
        public static string GetChartDataFecha(string fecha1, string fecha2)
        {
            var chartData = new object[3];

            chartData[0] = new object[] {
                "Product Category",
                "Asientos"
            };
            EventoBLL        even              = new EventoBLL();
            int              cantTotal         = 0;
            int              cantTotalVendidas = 0;
            DateTime         fechaInicio       = DateTime.Parse(fecha1);
            DateTime         fechaFin          = DateTime.Parse(fecha2);
            List <EventoBEL> eventos           = even.buscarEventosRango(fechaInicio, fechaFin);

            foreach (EventoBEL evento in eventos)
            {
                cantTotal         += even.totalEntradasPorEventos(evento.IdEvento);
                cantTotalVendidas += even.totalEntradasVendidasPorEventos(evento.IdEvento);
            }
            chartData[1] = new object[] { "Asientos Disponibles", cantTotal };
            chartData[2] = new object[] { "Asientos Vendidos", cantTotalVendidas };
            var jsonSerializator = new JavaScriptSerializer();

            return(jsonSerializator.Serialize(chartData));
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                UsuarioBEL     usuario   = (UsuarioBEL)Session["usuarioConectado"];
                TipoAsientoBLL bllTipo   = new TipoAsientoBLL();
                EventoBLL      eventoBLL = new EventoBLL();
                int            rut       = usuario.Rut;

                ClienteTicketBLL bllClienteTicket = new ClienteTicketBLL();

                ddlEvento.DataSource     = eventoBLL.traerEventos(rut);
                ddlEvento.DataTextField  = "Nombre";
                ddlEvento.DataValueField = "IdEvento";
                ddlEvento.DataBind();

                ddlTipoAsiento.DataSource     = bllTipo.traerTiposAsientos();
                ddlTipoAsiento.DataTextField  = "Nombre";
                ddlTipoAsiento.DataValueField = "IdTipoAsiento";
                ddlTipoAsiento.DataBind();
                if (eventoBLL.traerEventos(rut).Count != 0)
                {
                    string idEvento = ddlEvento.SelectedItem.Value;
                    GetChartDataTipoAsiento("1");
                }
            }
        }
Ejemplo n.º 10
0
 // GET: Registros/Create
 public ActionResult Create()
 {
     ViewBag.idaporte     = new SelectList(AporteBLL.List(), "idaporte", "descripcion");
     ViewBag.idevento     = new SelectList(EventoBLL.ListToNames(), "idevento", "nombre");
     ViewBag.idvoluntario = new SelectList(VoluntarioBLL.ListToNames(), "idvoluntario", "nombres");
     return(View());
 }
Ejemplo n.º 11
0
        public IActionResult GetAll()
        {
            EventoBLL eventoBLL = new EventoBLL();
            var       get       = eventoBLL.GetAll();

            return(Json(get));
        }
Ejemplo n.º 12
0
        public IActionResult Get(int id)
        {
            EventoBLL eventoBLL = new EventoBLL();
            var       evento    = eventoBLL.Get(id);

            return(Json(evento));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Carga la grilla con los recintos registrados
        /// </summary>
        protected void ddlRecintos_SelectedIndexChanged(object sender, EventArgs e)
        {
            int       idRecinto = Int32.Parse(ddlRecintos.SelectedItem.Value);
            EventoBLL evBLL     = new EventoBLL();
            PerfilBEL usuario   = (PerfilBEL)Session["usuarioConectado"];

            String[] separadorRut = usuario.Usuario.Split('-');
            grvEventos.DataSource = evBLL.traerEventoPorRecintos(idRecinto, Int32.Parse(separadorRut[0]));
            grvEventos.DataBind();
        }
Ejemplo n.º 14
0
        protected void eventosCriadoRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                int eventoID = (int)DataBinder.Eval(e.Item.DataItem, "Evento_ID");

                ((Repeater)e.Item.FindControl("focoEvCriadosRepeater")).DataSource = EventoBLL.ListarEventoFoco(eventoID);
                ((Repeater)e.Item.FindControl("focoEvCriadosRepeater")).DataBind();
            }
        }
 public ActionResult Edit([Bind(Include = "idevento,nombre,fecha_inicio,fecha_final,organizador,idcategoria")] Evento evento)
 {
     if (ModelState.IsValid)
     {
         EventoBLL.Update(evento);
         return(RedirectToAction("Index"));
     }
     ViewBag.idcategoria = new SelectList(CategoriaBLL.List(), "idcategoria", "nombre", evento.idcategoria);
     return(View(evento));
 }
Ejemplo n.º 16
0
    public static Evento InsertarEvento(string nombre, string categoria,
                                        string descripcion, string fechaInicio, string fechaFin, string cantidadEquipos,
                                        string cantidadGrupos, string jugadoresPorEquipo)
    {
        Evento objEvento = EventoBLL.InsertWithReturn(nombre, categoria, descripcion,
                                                      Convert.ToDateTime(fechaInicio), Convert.ToDateTime(fechaFin),
                                                      Convert.ToInt32(cantidadEquipos), Convert.ToInt32(cantidadGrupos),
                                                      Convert.ToInt32(jugadoresPorEquipo));

        return(objEvento);
    }
Ejemplo n.º 17
0
        public JsonResult DeleteAula(int id)
        {
            var          aulBLL  = new AulaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblAula aula = aulBLL.RetrieveAulaByID(id);

                if (aula != null)
                {
                    var eveBLL = new EventoBLL();
                    List <tblEvento> listaEventos = eveBLL.RetrieveEventosAulaByID(id);

                    if (listaEventos.Count() >= 0)
                    {
                        //significa que tiene Eventos....
                    }

                    var            areaBLL    = new AreasBLL();
                    List <tblArea> listaAreas = areaBLL.RetrieveAreasAulaByID(id);

                    if (listaAreas.Count() >= 0)
                    {
                        //significa que tiene Areas....
                    }

                    bool banderita = aulBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Aula se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Aula NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Aula no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el Registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 18
0
 public static int EliminarEvento(int idEvento)
 {
     try
     {
         EventoBLL.Delete(idEvento);
         return(idEvento);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// Carga la pagina con los datos del evento a comprar
            /// </summary>
            if (!IsPostBack)
            {
                TiposTicketBLL bllTipos   = new TiposTicketBLL();
                EventoBLL      bllEvento  = new EventoBLL();
                RecintoBLL     bllRecinto = new RecintoBLL();
                AsientoBLL     bllAsiento = new AsientoBLL();
                /// <summary>
                /// El usuario debe estar registrado para comprar entradas
                /// </summary>
                if (Request.QueryString["evento"] != null)
                {
                    if (Session["usuarioConectado"] == null)
                    {
                        Response.Write("<script>alert('Necesitas iniciar sesión para comprar');window.location='Registro.aspx';</script>");
                        return;
                    }
                    int idEvento = Int32.Parse(Request.QueryString["evento"].ToString());

                    EventoBEL  evento  = bllEvento.traerEventoId(idEvento);
                    RecintoBEL recinto = bllRecinto.traerRecintoPorId(evento.IdRecinto);
                    this.listaAsientos       = new ArrayList();
                    this.listaGrilla         = new ArrayList();
                    Session["listaAsientos"] = this.listaAsientos;
                    Session["listaGrilla"]   = this.listaGrilla;

                    ddlTipoEntrada.DataSource     = bllTipos.traerTiposTicket(idEvento);
                    ddlTipoEntrada.DataValueField = "IdTipoTicket";
                    ddlTipoEntrada.DataTextField  = "Descripcion";
                    ddlTipoEntrada.DataBind();
                    ddlTipoEntrada.Items.Insert(0, new ListItem("..Seleccione..", "-1"));

                    lblTitulo.Text            = evento.Nombre;
                    imgEvento.ImageUrl        = evento.Imagen;
                    lblContenido.Text         = evento.Descripcion;
                    imgRecinto.ImageUrl       = recinto.ImagenRecinto;
                    lblIdEvento.Text          = idEvento.ToString();
                    lblIdRecinto.Text         = evento.IdRecinto.ToString();
                    btnAgregarAsiento.Enabled = false;
                    btnPagar.Enabled          = false;
                    lblErrCant.Visible        = false;
                    lblselect.Visible         = false;
                }
                else
                {
                    Response.Redirect("EventosSemana.aspx");
                }
            }
        }
Ejemplo n.º 20
0
 public ActionResult Edit([Bind(Include = "idregistro,idvoluntario,idevento,idaporte")] Registro registro)
 {
     if (ModelState.IsValid)
     {
         RegistroBLL.Update(registro);
         return(RedirectToAction("Index"));
     }
     ViewBag.idaporte     = new SelectList(AporteBLL.List(), "idaporte", "descripcion", registro.idaporte);
     ViewBag.idevento     = new SelectList(EventoBLL.ListToNames(), "idevento", "nombre", registro.idevento);
     ViewBag.idvoluntario = new SelectList(VoluntarioBLL.ListToNames(), "idvoluntario", "nombres", registro.idvoluntario);
     return(View(registro));
 }
 public IHttpActionResult Delete(int id)
 {
     try
     {
         EventoBLL.Delete(id);
         return(Ok("Evento eliminado correctamente"));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }
 public IHttpActionResult Post(Evento Evento)
 {
     try
     {
         EventoBLL.Create(Evento);
         return(Content(HttpStatusCode.Created, "Evento creado correctamente"));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
 public IHttpActionResult Put(Evento Evento)
 {
     try
     {
         EventoBLL.Update(Evento);
         return(Content(HttpStatusCode.OK, "Evento actualizado correctamente"));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Ejemplo n.º 24
0
    public static Evento ActualizarEvento(string nombre, string categoria,
                                          string descripcion, string fechaInicio, string fechaFin, string cantidadGrupos,
                                          string cantidadEquipos, string jugadoresPorEquipo, string id)
    {
        EventoBLL.Update(nombre, categoria, descripcion, Convert.ToDateTime(fechaInicio),
                         Convert.ToDateTime(fechaFin), Convert.ToInt32(cantidadEquipos),
                         Convert.ToInt32(cantidadGrupos), Convert.ToInt32(jugadoresPorEquipo),
                         Convert.ToInt32(id));
        Evento objEvento = EventoBLL.SelectById(Convert.ToInt32(id));

        return(objEvento);
    }
 public IHttpActionResult Get()
 {
     try
     {
         List <Evento> todos = EventoBLL.List();
         return(Content(HttpStatusCode.OK, todos));
         //return Json(todos);
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }
        // GET: Eventos/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Evento evento = EventoBLL.Get(id);

            if (evento == null)
            {
                return(HttpNotFound());
            }
            return(View(evento));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Carga la grilla con los eventos del select seleccionado (tipo de evento)
        /// </summary>
        private void cargaEventos()
        {
            EventoBLL        events  = new EventoBLL();
            List <EventoBEL> eventos = new List <EventoBEL>();
            int id = Int32.Parse(ddlFiltro.SelectedValue);

            if (id == -5)
            {
                id = 6;
            }
            eventos = events.traerEventoPorTipoEvento(id);
            grvEventos.DataSource = eventos;
            grvEventos.DataBind();
        }
Ejemplo n.º 28
0
        private void CarregarEventosParticipando(int usuario_id)
        {
            IEnumerable <Participante> participantes = ParticipanteBLL.ListarParticipacoes(usuario_id);

            if (participantes.Count() > 0)
            {
                eventosParticipandoRepeater.DataSource = EventoBLL.ListarEventosParticipando(participantes);
                eventosParticipandoRepeater.DataBind();
            }
            else
            {
                eventosParticipandoRepeater.DataSource = null;
                eventosParticipandoRepeater.DataBind();
            }
        }
Ejemplo n.º 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     /// <summary>
     /// Carga la grilla con todos los eventos que esten en estado p (proximo)
     /// </summary>
     if (!IsPostBack)
     {
         cargarDDL();
         cargaEventos();
         grvEventos.Visible = true;
         EventoBLL evento = new EventoBLL();
         grvEventos.DataSource = evento.traerEventosProximos();
         grvEventos.DataBind();
     }
 }
        // GET: Eventos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Evento evento = EventoBLL.Get(id);

            if (evento == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idcategoria = new SelectList(CategoriaBLL.List(), "idcategoria", "nombre", evento.idcategoria);
            return(View(evento));
        }