HTNResp/Controllers/HomeController.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Text;
using System.Web.Mvc;
using System.Data.SqlClient;
using HTNResp.Models;
using Maticsoft.DBUtility;
using Newtonsoft.Json;
using System.Web.Script.Serialization;
using HTNResp.Codes;

namespace HTNResp.Controllers
{
    public class HomeController : Controller
    {

        public ActionResult Index()
        {
            Session["status"] = Request.Params["status"];
            return View();
        }
        [Login(Feedback = -7)]
        public ActionResult Login(string Username, string Password)
        {
            // \ _ " " + 
            HTNResp.BLL.UserTable bllUser = new HTNResp.BLL.UserTable();
            if (string.IsNullOrEmpty(Username) || string.IsNullOrEmpty(Password))
            {
                return this.Json(new { result = 0, data = "" });
            }
            // Password = encryptPwd(Password);

            string strSql = "UserCode='" + Username + "' and Password='" + Password + "'";
            List<Model.UserTable> userList = bllUser.DataTableToList(bllUser.GetList(strSql).Tables[0]);

            //authority
            if (userList.Count > 0)
            {

                Model.UserTable userModel = userList[0];
                strSql = "select * from AccessTable where ID in (select TableID from PermissionTable where UserID = " + userModel.ID + ")";
                List<Model.AccessTable> tableList = new BLL.AccessTable().DataTableToList(DbHelperSQL.Query(strSql).Tables[0]);

                //get granted table
                string sessionString = "";
                if (tableList.Count != 0)
                {
                    sessionString += "[";
                    foreach (Model.AccessTable tableModel in tableList)
                    {
                        sessionString += new JavaScriptSerializer().Serialize(tableModel) + ",";
                    }
                    sessionString = sessionString.Remove(sessionString.Length - 1);
                    sessionString += "]";
                }
                //set session time out
                Session.Timeout = 30;
后面还有 32 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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