예제 #1
0
        public void SaveLogin(Login std)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            using (var context = new TOContext())
            {
                context.login.Add(std);
                context.SaveChanges();
            }
        }
예제 #2
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();
            }
        }
예제 #3
0
        public void SaveTeacher(Teacher teach)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            using (var context = new TOContext())
            {
                context.teacher.Add(teach);
                context.SaveChanges();
            }
        }
예제 #4
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();
            }
        }
예제 #5
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();
            }
        }