Exemple #1
0
        public int insereReclamacao(ReclamacaoDal r)
        {
            PoaEntities db   = new PoaEntities();
            Reclamacao  nova = new Reclamacao();

            nova.UserId      = r.UserId;
            nova.BairroId    = r.BairroId;
            nova.CategoriaId = r.CategoriaId;
            nova.Titulo      = r.Titulo;
            nova.Descricao   = r.Descricao;
            nova.Endereco    = r.Endereco;
            nova.Foto        = r.Foto;
            nova.Data        = DateTime.Now;
            nova.StatusId    = r.StatusId;

            try
            {
                db.Reclamacoes.Add(nova);
                db.SaveChanges();
                return(1);
            }
            catch (Exception e)
            {
                string a = e.ToString();
                return(0);
            }
        }
Exemple #2
0
        public int altaraReclamacao(ReclamacaoDal r)
        {
            PoaEntities db   = new PoaEntities();
            Reclamacao  nova = new Reclamacao();

            var getReclama = (from reclama in db.Reclamacoes
                              where reclama.ReclamacaoId == r.ReclamacaoId
                              select reclama).Single();

            getReclama.StatusId = r.StatusId;
            try
            {
                db.SaveChanges();
                return(1);
            }
            catch (Exception e)
            {
                string a = e.ToString();
                return(0);
            }
        }
        public int altaraReclamacao(ReclamacaoDal r)
        {
            PoaEntities db = new PoaEntities();
            Reclamacao nova = new Reclamacao();

            var getReclama = (from reclama in db.Reclamacoes
                           where reclama.ReclamacaoId == r.ReclamacaoId
                           select reclama).Single();

            getReclama.StatusId = r.StatusId;
            try
            {
                db.SaveChanges();
                return 1;
            }
            catch (Exception e)
            {
                string a = e.ToString();
                return 0;
            }
        }
        public int insereReclamacao(ReclamacaoDal r)
        {
            PoaEntities db = new PoaEntities();
            Reclamacao nova = new Reclamacao();
            nova.UserId = r.UserId;
            nova.BairroId = r.BairroId;
            nova.CategoriaId = r.CategoriaId;
            nova.Titulo = r.Titulo;
            nova.Descricao = r.Descricao;
            nova.Endereco = r.Endereco;
            nova.Foto = r.Foto;
            nova.Data = DateTime.Now;
            nova.StatusId = r.StatusId;

            try
            {
                db.Reclamacoes.Add(nova);
                db.SaveChanges();
                return 1;
            }
            catch (Exception e)
            {
                string a = e.ToString();
                return 0;
            }
        }