public void DeleteClass(int id)
        {
            var db      = new OOPCSEntities();
            var student = db.PM06660.Find(id);

            db.PM06660.Remove(student);
            db.SaveChanges();
        }
        public void UpdateStudent(int id, string code, string name, bool gender, string hometown)
        {
            var db         = new OOPCSEntities();
            var oldStudent = db.PM06660.Find(id);

            oldStudent.CODE            = code;
            oldStudent.NAME            = name;
            oldStudent.GENDER          = gender;
            oldStudent.HOMETOWN        = hometown;
            db.Entry(oldStudent).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
        public void CreateStudent(string code, string name, bool gender, string hometown)
        {
            var newStudent = new PM06660();

            newStudent.CODE     = code;
            newStudent.NAME     = name;
            newStudent.GENDER   = gender;
            newStudent.HOMETOWN = hometown;

            var db = new OOPCSEntities();

            db.PM06660.Add(newStudent);
            db.SaveChanges();
        }