Пример #1
0
        public static void insereCategoria(Categoria nova)
        {
            ReclamePOAContext _db = new ReclamePOAContext();

            _db.Categorias.Add(nova);
            _db.SaveChanges();
        }
Пример #2
0
        public static void insereReclamacao(Reclamacao nova)
        {
            ReclamePOAContext _db = new ReclamePOAContext();

            _db.Reclamacaos.Add(nova);
            _db.SaveChanges();
        }
Пример #3
0
        public static Categoria getCategoriaById(int cod)
        {
            ReclamePOAContext _db = new ReclamePOAContext();
            var result            = (from c in _db.Categorias
                                     where c.CategoriaId == cod
                                     select c).FirstOrDefault();

            return(result);
        }
Пример #4
0
        public static List<Comentario> getComentariosById(int cod)
        {
            ReclamePOAContext _db = new ReclamePOAContext();
            List<Comentario> d = (from c in _db.Comentarios
                    where c.ReclamacaoID == cod
                    select c).ToList();

            return d.ToList();
        }
Пример #5
0
        public static Categoria getCategoriaById(int cod)
        {
            ReclamePOAContext _db = new ReclamePOAContext();
            var result = (from c in _db.Categorias
                          where c.CategoriaId == cod
                          select c).FirstOrDefault();

            return result;
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
               gvCategorias.DataSource = Repositorio.getCategorias();
                ReclamePOAContext _db = new ReclamePOAContext();
                gvCategorias.DataSource = _db.Categorias.ToList();

                gvCategorias.DataBind();
            }
        }
Пример #7
0
        protected void cmdInserir_Click(object sender, EventArgs e)
        {
            Categoria nova = new Categoria
                {

                    Nome = txtNome.Text,
                    Descricao = txtDescricao.Text
                };

            ReclamePOAContext _db = new ReclamePOAContext();
               _db.Categorias.Add(nova);
               _db.SaveChanges();
            Response.Redirect("Categorias.aspx");
        }
Пример #8
0
        public static List <Categoria> getCategorias()
        {
            ReclamePOAContext _db = new ReclamePOAContext();

            return(_db.Categorias.ToList());
        }
Пример #9
0
        public static List <Reclamacao> getReclamacoes()
        {
            ReclamePOAContext _db = new ReclamePOAContext();

            return(_db.Reclamacaos.ToList());
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack) {
                ReclamePOAContext _db = new ReclamePOAContext();

                ddlCategoria.DataSource = _db.Categorias.ToList();
                ddlCategoria.DataTextField = "Nome";
                ddlCategoria.DataValueField = "CategoriaId";
                ddlCategoria.DataBind();
                GridView1.DataSource = _db.Reclamacaos.ToList();
                GridView1.AutoGenerateSelectButton=true;
                GridView1.DataBind();
            }
        }
Пример #11
0
 public static void insereReclamacao(Reclamacao nova)
 {
     ReclamePOAContext _db = new ReclamePOAContext();
     _db.Reclamacaos.Add(nova);
     _db.SaveChanges();
 }
Пример #12
0
 public static void insereComentario(Comentario novo)
 {
     ReclamePOAContext _db = new ReclamePOAContext();
     _db.Comentarios.Add(novo);
     _db.SaveChanges();
 }
Пример #13
0
 public static void insereCategoria(Categoria nova)
 {
     ReclamePOAContext _db = new ReclamePOAContext();
     _db.Categorias.Add(nova);
     _db.SaveChanges();
 }
Пример #14
0
 public static List<Reclamacao> getReclamacoes()
 {
     ReclamePOAContext _db = new ReclamePOAContext();
     return _db.Reclamacaos.ToList();
 }
Пример #15
0
 public static List<Categoria> getCategorias()
 {
     ReclamePOAContext _db = new ReclamePOAContext();
     return _db.Categorias.ToList();
 }