Esempio n. 1
0
        public void addKlass(Klass obj)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2()) 
            {

                db.Klasses.Add(obj);
                db.SaveChanges();
            
            }
        }
Esempio n. 2
0
        public void deleteKlass(int id)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {

                var q=db.Klasses.SingleOrDefault(x=>x.Id == id);
                db.Klasses.Remove(q);
                db.SaveChanges();

            }
        }
Esempio n. 3
0
        public void editKlass(Klass obj)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {

                obj.Name = obj.Name;
                obj.Degree = obj.Degree;
                obj.Date = DateTime.Today;
                db.SaveChanges();
            }

        }