Пример #1
0
        //DELETE()
        public void BorrarDepartamento(int num)
        {
            DEPT dep = this.BuscarDepartamento(num);

            contexto.DEPT.Remove(dep);
            contexto.SaveChanges();
        }
Пример #2
0
        //PUT()
        public void ModificarDepartamento(int num, String nom, String loc)
        {
            DEPT dep = this.BuscarDepartamento(num);

            dep.DNOMBRE = nom;
            dep.LOC     = loc;
            contexto.SaveChanges();
        }
Пример #3
0
        //POST
        public void InsertarDepartamento(int num, String nom, String loc)
        {
            DEPT dep = new DEPT();

            dep.DEPT_NO = num;
            dep.DNOMBRE = nom;
            dep.LOC     = loc;
            contexto.DEPT.Add(dep);
            contexto.SaveChanges();
        }