Ejemplo n.º 1
0
 //删除用户
 public bool delUser(int id)
 {
     using (Trans t = new Trans())
     {
         try
         {
             DBHelper  db  = new DBHelper();
             string    sql = "select id from papers where teacherId=" + id;
             DbCommand cmd = db.GetSqlStringCommand(sql);
             using (DbDataReader reader = db.ExecuteReader(cmd))
             {
                 while (reader.Read())
                 {
                     TeacherFunctionForm.delPaper((int)reader[0]);
                 }
             }
             delInScores(id, t);
             delInStu_answers(id, t);
             delInUsers(id, t);
             t.Commit();
             return(true);
         }
         catch
         {
             t.RollBack();
             return(false);
         }
     }
 }
Ejemplo n.º 2
0
        private void TeacherForm_Load(object sender, EventArgs e)
        {
            ViewHelper.size = this.Size;

            _tchFunction          = new TeacherFunctionForm();
            tchFunction.MdiParent = this;
            tchFunction.Show();

            _tchWelcome          = new TeacherWelcomeForm();
            tchWelcome.MdiParent = this;
            tchWelcome.Show();
            this.Opacity = 100D;
        }
Ejemplo n.º 3
0
        public void delInUsers(int id, Trans t)
        {
            string sql = "delete from users where id=" + id;

            TeacherFunctionForm.executeDel(sql, t);
        }
Ejemplo n.º 4
0
        public void delInStu_answers(int id, Trans t)
        {
            string sql = "delete from stu_answers where studentId=" + id;

            TeacherFunctionForm.executeDel(sql, t);
        }