示例#1
0
        public void EditStudent(Student std)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            using (var context = new TOContext())
            {
                context.Entry(std).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
            }
        }
示例#2
0
        public void DeleteStudent(int ID)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            using (var context = new TOContext())
            {
                var student = context.student.Find(ID);

                context.Entry(student).State = System.Data.Entity.EntityState.Deleted;
                context.SaveChanges();
            }
        }
示例#3
0
        public void DeleteTeacher(int ID)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            using (var context = new TOContext())
            {
                var teacher = context.teacher.Find(ID);

                context.Entry(teacher).State = System.Data.Entity.EntityState.Deleted;
                context.SaveChanges();
            }
        }