Esempio n. 1
0
 public int DeleteTeacher(TeacherInfo teacher)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     SqlParameter[] objParams = new SqlParameter[1];
     objParams[0] = new SqlParameter("@ID", teacher.TeacherID);
     return objSqlHelper.ExecuteNonQuery("je_TE_DeleteTeacher", objParams);
 }
Esempio n. 2
0
 public void InsertTeacher(TeacherInfo teacher)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     SqlParameter[] objParams = new SqlParameter[5];
     objParams[0] = new SqlParameter("@Name", teacher.Name);
     objParams[1] = new SqlParameter("@Image", teacher.Image);
     objParams[2] = new SqlParameter("@SmallDec", teacher.SmallDec);
     objParams[3] = new SqlParameter("@Dec", teacher.Dec);
     objParams[4] = new SqlParameter("@IsMain", teacher.IsMain);
     objSqlHelper.ExecuteNonQuery("je_TE_InsertTeacher", objParams);
 }
Esempio n. 3
0
 public int UpdateTeacher(TeacherInfo teacher)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     SqlParameter[] objParams = new SqlParameter[6];
     objParams[0] = new SqlParameter("@Name", teacher.Name);
     objParams[1] = new SqlParameter("@Image", teacher.Image);
     objParams[2] = new SqlParameter("@SmallDec", teacher.SmallDec);
     objParams[3] = new SqlParameter("@Dec", teacher.Dec);
     objParams[4] = new SqlParameter("@IsMain", teacher.IsMain);
     objParams[5] = new SqlParameter("@ID", teacher.TeacherID);
     return objSqlHelper.ExecuteNonQuery("je_TE_UpdateTeacher", objParams);
 }
Esempio n. 4
0
 public TeacherInfo GetTeacherByID(int teacherID)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     SqlParameter[] objParams = new SqlParameter[1];
     objParams[0] = new SqlParameter("@ID", SqlDbType.Int, 4);
     objParams[0].Value = teacherID;
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_TE_GetTeacherByID", objParams);
     TeacherInfo item = new TeacherInfo();
     while (reader.Read())
     {
         item.TeacherID = reader.GetInt32(reader.GetOrdinal("ID"));
         item.Name = reader.GetString(reader.GetOrdinal("Name"));
         item.Image = reader.GetString(reader.GetOrdinal("Image"));
         item.IsMain = reader.GetBoolean(reader.GetOrdinal("IsMain"));
         item.AddDate = reader.GetDateTime(reader.GetOrdinal("AddDate"));
         item.SmallDec = reader.GetString(reader.GetOrdinal("SmallDec"));
         item.Dec = reader.GetString(reader.GetOrdinal("Dec"));
     }
     reader.Close();
     return item;
 }
Esempio n. 5
0
 /// <summary>
 /// 删除教师信息
 /// </summary>
 /// <param name="link"></param>
 /// <returns></returns>
 public static int DeleteTeacher(TeacherInfo teacher)
 {
     return teachers.DeleteTeacher(teacher);
 }
Esempio n. 6
0
 /// <summary>
 /// 更新教师信息
 /// </summary>
 /// <param name="link"></param>
 /// <returns></returns>
 public static int UpdateTeacher(TeacherInfo teacher)
 {
     return teachers.UpdateTeacher(teacher);
 }
Esempio n. 7
0
 /// <summary>
 /// 添加教师信息
 /// </summary>
 /// <param name="link"></param>
 public static void InsertTeacher(TeacherInfo teacher)
 {
     teachers.InsertTeacher(teacher);
 }