Example #1
0
        public static bool Inserir(int evento, string usuario)
        {
            try
            {
                dbEventosEntities db = new dbEventosEntities();
                Checkin           i  = new Checkin();

                /*Evento e = db.Eventoes.Find(evento);
                 * Usuario u = db.Usuarios.Find(usuario);
                 * i.Evento = e;
                 * i.Usuario = u;
                 * i.notificado = true;*/

                i.Id            = getLasId();
                i.data_criacao  = DateTime.Now;
                i.EventoId      = evento;
                i.Usuario_email = usuario;

                db.Checkin.Add(i);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static bool Inserir(Categoria c)
        {
            try
            {
                dbEventosEntities db = new dbEventosEntities();

                db.Categorias.Add(c);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static bool Alterar(Categoria c)
        {
            try
            {
                dbEventosEntities db  = new dbEventosEntities();
                Categoria         cat = new Categoria();
                cat = db.Categorias.Find(c.nome);

                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #4
0
        public static bool Excluir(Checkin i)
        {
            try
            {
                dbEventosEntities db    = new dbEventosEntities();
                Checkin           inscr = new Checkin();

                inscr = db.Checkin.Find(i.Id);
                db.Checkin.Remove(inscr);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #5
0
        public static bool Inserir(Usuario u)
        {
            try
            {
                dbEventosEntities db = new dbEventosEntities();

                u.senha = CreateMD5(u.senha);

                db.Usuarios.Add(u);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #6
0
        public static bool Excluir(Feedback u)
        {
            try
            {
                dbEventosEntities db   = new dbEventosEntities();
                Feedback          user = new Feedback();

                user = db.Feedbacks.Find(u.Id);
                db.Feedbacks.Remove(user);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #7
0
        public static bool Excluir(Sugesto c)
        {
            try
            {
                dbEventosEntities db  = new dbEventosEntities();
                Sugesto           cat = new Sugesto();

                cat = db.Sugestoes.Find(c.Id);
                db.Sugestoes.Remove(cat);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #8
0
        public static bool Excluir(Evento u)
        {
            try
            {
                dbEventosEntities db = new dbEventosEntities();
                Evento            e  = new Evento();

                e = db.Eventoes.Find(u.Id);
                db.Eventoes.Remove(e);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static bool Excluir(Inscricao i)
        {
            try
            {
                dbEventosEntities db    = new dbEventosEntities();
                Inscricao         inscr = new Inscricao();

                inscr = db.Inscricoes.Find(i.Id);
                db.Inscricoes.Remove(inscr);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #10
0
        public static bool Excluir(Usuario u)
        {
            try
            {
                dbEventosEntities db   = new dbEventosEntities();
                Usuario           user = new Usuario();

                user = db.Usuarios.Find(u.email);

                foreach (Evento e in user.Eventoes)
                {
                    pnEventos.Excluir(e);
                }

                db.Usuarios.Remove(user);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #11
0
        public static bool Alterar(Usuario u)
        {
            try
            {
                dbEventosEntities db   = new dbEventosEntities();
                Usuario           user = new Usuario();
                user = db.Usuarios.Find(u.email);

                user.nome = u.nome;
                if (u.senha != "")
                {
                    user.senha = CreateMD5(u.senha);
                }
                user.data_nascimento = u.data_nascimento;

                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static bool Excluir(Disciplina c)
        {
            try
            {
                dbEventosEntities db  = new dbEventosEntities();
                Disciplina        cat = new Disciplina();

                cat = db.Disciplinas.Find(c.nome);
                //foreach(Evento e in cat.Eventos)
                //{
                //    e.Disciplina_nome = cat.nome;
                //    e.Disciplina = null;
                //}

                db.Disciplinas.Remove(cat);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }