Web/Model/TeacherExtend.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;
using System.Web.UI.WebControls;//Please add references

namespace StudentExamination.Model
{
    //扩展Department类,增加自定义的方法

    public partial class Teacher
    {      
        /// <summary>
        ///用户登录
        /// </summary>       
        public void Login(string loginName, string loginPassword)
        {
            //
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select TeacherID,TeacherCode,TeacherName,DepartmentID,IsUsed,Password,CreateDate ");
            strSql.Append(" FROM [Teacher] ");
            strSql.Append("  where IsUsed = 1 and TeacherCode=@loginName ");
            SqlParameter[] parameters = {
					new SqlParameter("@loginName", SqlDbType.NChar,30)			};
            parameters[0].Value = loginName;
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["TeacherID"] != null && ds.Tables[0].Rows[0]["TeacherID"].ToString() != "")
                {
                    this.TeacherID = int.Parse(ds.Tables[0].Rows[0]["TeacherID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TeacherCode"] != null && ds.Tables[0].Rows[0]["TeacherCode"].ToString() != "")
                {
                    this.TeacherCode = ds.Tables[0].Rows[0]["TeacherCode"].ToString();
                }
                if (ds.Tables[0].Rows[0]["TeacherName"] != null && ds.Tables[0].Rows[0]["TeacherName"].ToString() != "")
                {
                    this.TeacherName = ds.Tables[0].Rows[0]["TeacherName"].ToString();
                }
                if (ds.Tables[0].Rows[0]["DepartmentID"] != null && ds.Tables[0].Rows[0]["DepartmentID"].ToString() != "")
                {
                    this.DepartmentID = int.Parse(ds.Tables[0].Rows[0]["DepartmentID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsUsed"] != null && ds.Tables[0].Rows[0]["IsUsed"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["IsUsed"].ToString() == "1") || (ds.Tables[0].Rows[0]["IsUsed"].ToString().ToLower() == "true"))
                    {
                        this.IsUsed = true;
                    }
                    else
                    {
                        this.IsUsed = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["Password"] != null && ds.Tables[0].Rows[0]["Password"].ToString() != "")
                {
                    this.Password = ds.Tables[0].Rows[0]["Password"].ToString();
                }
后面还有 80 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。