Esempio n. 1
0
        public PM23737 GetStudent(int id)
        {
            var db     = new OOPCSEntities();
            var @class = db.PM23737.Find(id);

            return(@class);
        }
Esempio n. 2
0
        public void DeleteStudent(int id)
        {
            var db     = new OOPCSEntities();
            var @class = db.PM23737.Find(id);

            db.PM23737.Remove(@class);
            db.SaveChanges();
        }
Esempio n. 3
0
        public void EditClass(int id, string name, string code, string hometown, bool gender)
        {
            var db    = new OOPCSEntities();
            var Class = db.PM23737.Find(id);

            Class.name            = name;
            Class.code            = code;
            Class.hometowm        = hometown;
            Class.gender          = gender;
            db.Entry(Class).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
Esempio n. 4
0
        public void AddClass(string name, string code, string hometown, bool gender)
        {
            var Class = new PM23737();

            Class.name     = name;
            Class.code     = code;
            Class.hometowm = hometown;
            Class.gender   = gender;
            var db = new OOPCSEntities();

            db.PM23737.Add(Class);
            db.SaveChanges();
        }
Esempio n. 5
0
        public PM23737[] GetStudent()
        {
            var db = new OOPCSEntities();

            return(db.PM23737.ToArray());
        }