protected void DoDeleteTeacher(string teacherID) { Teacher t = new Teacher(); t._teacherID = Int32.Parse(teacherID); DBManager db = new MySQLDBManager(Config.DB_SERVER, Config.DB_NAME, Config.DB_USER, Config.DB_PASSWORD, Config.DB_CHAR_ENC); db.Connect(); db.BeginTransaction(IsolationLevel.ReadCommitted); // delete paid_group_teacher_mapping first db.Execute("DELETE FROM paid_group_teacher_mapping WHERE teacher_id=" + teacherID); // delete teacher t.DeleteToDB(db); db.Commit(); db.Close(); }
protected void DoDeleteTeacher(string teacherID) { Teacher t = new Teacher(); t._teacherID = Int32.Parse(teacherID); DBManager db = new MySQLDBManager(Config.DB_SERVER, Config.DB_NAME, Config.DB_USER, Config.DB_PASSWORD, Config.DB_CHAR_ENC); db.Connect(); db.BeginTransaction(IsolationLevel.ReadCommitted); // delete paid_group_teacher_mapping first db.Execute("DELETE FROM paid_group_teacher_mapping WHERE teacher_id="+teacherID); // delete teacher t.DeleteToDB(db); db.Commit(); db.Close(); }