Beispiel #1
0
        /// <summary>
        /// ����Ա��ӽ�ʦ�û�
        /// </summary>
        /// <param name="mTeacher">����ӵĽ�ʦ����</param>
        /// <returns>�Ƿ���ӳɹ����ɹ��򷵻�true,ʧ���򷵻�false</returns>
        public bool AddTeacher(TeacherInfo mTeacher)
        {
            SqlParameter[] parms = {
                new SqlParameter("@userName",mTeacher.StrUserName),
                new SqlParameter("@pwd",mTeacher.StrPassword),
                new SqlParameter("@name",mTeacher.StrTeacherName),
                new SqlParameter("@identityID",mTeacher.StrIdentityId)
            };

            bool isSuccess = false;
            int affectedRows = SQLHelper.ExecuteNonQuery(SQLHelper.ConnectionStringSTEduSys,
                CommandType.StoredProcedure, "SP_AddTeacher", parms);

            if (affectedRows > 0)
            {
                isSuccess = true;
            }
            return isSuccess;
        }
Beispiel #2
0
 /// <summary>
 /// ����Ա��ӽ�ʦ�û�
 /// </summary>
 /// <param name="mTeacher">����ӵĽ�ʦ����</param>
 /// <returns>�Ƿ���ӳɹ����ɹ��򷵻�true,ʧ���򷵻�false</returns>
 public bool AddTeacher(TeacherInfo mTeacher)
 {
     return dal.AddTeacher(mTeacher);
 }
 public TeacherInfo GetTeacherByUserName(string userName)
 {
     SqlParameter param = new SqlParameter("@username", userName);
     TeacherInfo t = new TeacherInfo();
     SqlDataReader r = SQLHelper.ExecuteReader(SQLHelper.ConnectionStringSTEduSys,
         CommandType.StoredProcedure, "[SP_GetTeacherByUserName]", param);
     if (r.Read())
     {
         t.ITeacherId = Convert.ToInt32(r["ID"]);
         t.StrIdentityId = Convert.ToString(r["identityID"]);
         t.StrPassword = Convert.ToString(r["pwd"]);
         t.StrTeacherName = Convert.ToString(r["name"]);
         t.StrUserName = Convert.ToString(r["username"]);
     }
     return t;
 }
Beispiel #4
0
        // �佣����ӣ�2009-9-11
        /// <summary>
        /// ���ݽ�ʦ�����֤�ŵõ���ʦ
        /// </summary>
        /// <param name="strIdentityID">��ʦ�����֤��</param>
        /// <returns>��ʦ</returns>
        public TeacherInfo GetTeacherByIdentityID(string strIdentityID)
        {
            SqlParameter param = new SqlParameter("@identityID", strIdentityID);
            TeacherInfo tch = new TeacherInfo();
            SqlDataReader reader = SQLHelper.ExecuteReader(SQLHelper.ConnectionStringSTEduSys,
                CommandType.StoredProcedure, "[SP_GetTeacherByIdentity]", param);

            if (reader.Read())
            {
                tch.ITeacherId = Convert.ToInt32(reader["ID"]);
                tch.StrIdentityId = strIdentityID;
                tch.StrPassword = Convert.ToString(reader["pwd"]);
                tch.StrTeacherName = Convert.ToString(reader["name"]);
                tch.StrUserName = Convert.ToString(reader["UserName"]);
            }

            return tch;
        }