App_Code/DAO/AdminDAO.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using HourseRentSystem.DB;
using HourseRentSystem.Model;


namespace HourseRentSystem.DAO
{
    /// <summary>
    ///AdminDAO 的摘要说明: 管理员信息处理数据层
    /// </summary>
    public class AdminDAO
    {
        public AdminDAO()
        {
             
        }

        /*查询帐号是否存在,存在返回true,不存在返回false*/
        public bool ExistUsername(string username)
        {
            DataBase db = new DataBase();
            string query_sql = "select * from [admin] where username = " + SqlString.GetQuotedString(username);
            System.Data.DataSet ds = db.GetDataSet(query_sql);
            if (ds.Tables[0].Rows.Count == 0) 
                return false; 
            return true;
        }


        /*查询帐号密码是否都正确*/
        public bool CheckUser(Admin admin)
        {
            DataBase db = new DataBase();
            string query_sql = "select * from [admin] where username = " + SqlString.GetQuotedString(admin.getUsername()) + " and password = " + SqlString.GetQuotedString(admin.getPassword());
            System.Data.DataSet ds = db.GetDataSet(query_sql);
            if (ds.Tables[0].Rows.Count == 0)
                return false;
            return true;
        }
    }

}

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

AI 解读 AI

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

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