Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }