Exams/Controllers/HomeController.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using System.IO;
using Exams.Repository;
using Exams.Models;
using Exams.Utils;
namespace Exams.Controllers
{
public class HomeController :Exams.Areas.Admin.Controllers.BaseController
{
private EUserRepository _euser = new EUserRepository();
private ConfigRepository _config = new ConfigRepository();
private LogRepository _log = new LogRepository();
public ActionResult Index()
{
ViewBag.IPCount = _log.GetExamCount(Request.UserHostAddress);
ViewBag.DayCount = _log.GetDayExamCount(Request.UserHostAddress);
return View(ECache.ExamConfig);
}
EUserRepository _user = new EUserRepository();
public JsonResult UserList(string key, int rows = 20, int page = 1)
{
int count = 0;
List<object> list = _user.GetScorePageList(rows, page, out count);
return Json(new { total = count, rows = list }, JsonRequestBehavior.AllowGet);
}
public JsonResult GetCompany()
{
List<object> list = new List<object>();
foreach (Tuple<int, string> t in ECache.Company)
{
list.Add(new { id = t.Item1, text = t.Item2 });
}
return Json(list, JsonRequestBehavior.AllowGet);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
