Web/Model/StudentExtend.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 Student
{
/// <summary>
///用户登录
/// </summary>
public void Login(string loginName, string loginPassword)
{
//
StringBuilder strSql = new StringBuilder();
strSql.Append("select StudentID,StudentCode,DepartmentID,ClassID,IsUsed,StudentName,Password,CreateDate,IdentityCard,Email,Telephone,Sex,Birthday ");
strSql.Append(" FROM [Student] ");
strSql.Append(" where IsUsed = 1 and StudentCode=@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]["StudentID"] != null && ds.Tables[0].Rows[0]["StudentID"].ToString() != "")
{
this.StudentID = int.Parse(ds.Tables[0].Rows[0]["StudentID"].ToString());
}
if (ds.Tables[0].Rows[0]["StudentCode"] != null && ds.Tables[0].Rows[0]["StudentCode"].ToString() != "")
{
this.StudentCode = ds.Tables[0].Rows[0]["StudentCode"].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]["ClassID"] != null && ds.Tables[0].Rows[0]["ClassID"].ToString() != "")
{
this.ClassID = ds.Tables[0].Rows[0]["ClassID"].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]["StudentName"] != null && ds.Tables[0].Rows[0]["StudentName"].ToString() != "")
{
后面还有 77 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。