예제 #1
0
        public void Remover(int id)
        {
            Entities.tb_department remover = db.tb_department.First(t => t.id_department == id);

            db.tb_department.Remove(remover);
            db.SaveChanges();
        }
예제 #2
0
        public void Alterar(Entities.tb_department department)
        {
            Entities.tb_department list = db.tb_department.First(t => t.id_department == department.id_department);
            list.nm_department = department.nm_department;

            db.SaveChanges();
        }
예제 #3
0
        public Entities.tb_department ConsultaPorID(int id)
        {
            Entities.tb_department department = db.tb_department.FirstOrDefault(t => t.id_department == id);

            return(department);
        }
예제 #4
0
        public List <Entities.tb_department> ConsultarPorNome(Entities.tb_department department)
        {
            List <Entities.tb_department> list = db.tb_department.Where(l => l.nm_department == department.nm_department).ToList();

            return(list);
        }
예제 #5
0
        public void Inserir(Entities.tb_department department)
        {
            db.tb_department.Add(department);

            db.SaveChanges();
        }