Exemple #1
0
 private bool myLogin(string strTeacherNo, string strTeacherPwd, out string strMessage)
 {
     rollCallSysterm.Models.ITeacherManager teacherManager = new Models.ClassTeacherManager();
     rollCallSysterm.Entity.ClassTeacher    teacher        = teacherManager.Login(strTeacherNo, strTeacherPwd, out strMessage);
     if (teacher == null)
     {
         return(false);
     }
     else
     {
         Session.Add("curUser", teacher);//添加到Session对象中
         return(true);
     }
 }
 /// <summary>
 /// 检查教师信息是否已存在
 /// </summary>
 /// <param name="tno">职工号</param>
 /// <param name="strMessage">返回信息</param>
 /// <returns>返回TRUE表示用户已存在</returns>
 private bool checkTeacher(string tno, out string strMessage)
 {
     Entity.ClassTeacher    aTeacher;
     Models.ITeacherManager iTeacherManger = new Models.ClassTeacherManager();
     //从数据库中根据职工号获得教师,检查该教师是否为null,来验证该教师信息是否存在。
     aTeacher = iTeacherManger.GetTeacherByTno(tno, out strMessage);
     if (aTeacher == null)
     {
         strMessage = "不存在该教师";
         return(false);
     }
     else
     {
         strMessage = "已存在该教师";
         return(true);
     }
 }
 /// <summary>
 /// 保存一个教师信息到数据库中
 /// </summary>
 /// <param name="teacher">一个需要注册的教师对象</param>
 /// <param name="strMessage">返回执行信息</param>
 /// <returns>保存成功返回真</returns>
 private bool Register(Entity.ClassTeacher teacher, out string strMessage)
 {
     strMessage = "";
     Models.ITeacherManager TeacherManger = new Models.ClassTeacherManager();
     return(TeacherManger.Register(teacher, out strMessage));  //注册
 }