server/aspnetapp/Controllers/WebUI/ManageController.cs

(开头部分) 2KB

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

using aspnetapp.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace aspnetapp.Controllers
{
    public class ManageController : Controller
    {
        private readonly CounterContext _context;

        public ManageController(CounterContext context)
        {
            _context = context;
        }

        public ActionResult Index()
        {
            TemplateEntity? MCExcel = _context.Templates.FirstOrDefault(s => s.Type == (int)EnumCode.ExportFill.早餐模板Excel);
            ViewBag.MCExcel = MCExcel;
            TemplateEntity? NCExcel = _context.Templates.FirstOrDefault(s => s.Type == (int)EnumCode.ExportFill.午餐模板Excel);
            ViewBag.NCExcel = NCExcel;
            TemplateEntity? ECExcel = _context.Templates.FirstOrDefault(s => s.Type == (int)EnumCode.ExportFill.晚餐模板Excel);
            ViewBag.ECExcel = ECExcel;

            return View();
        }
        public async Task<ActionResult> LogIndexAsync(string optime, string opip, int? optype, int? pagesize, int? page = 0)
        {
            DateTime opTime = DateTime.Now.Date;
            DateTime temp = DateTime.Now;
            bool rt = DateTime.TryParse(optime, out temp);
            if (rt)
            {
                opTime = temp;
            }
            DateTime edTime = opTime.AddHours(23).AddMinutes(59).AddMilliseconds(59);
            if (optype == 99)
            {
                optype = null;
            }
            IQueryable<LogEntity> LogsListIQ = from s in _context.Logs
                                               select s;

            if (optype.HasValue)
            {
                LogsListIQ = LogsListIQ.Where(s => s.LogType == optype);
            }
            else
            {
                optype = 99;
            }

            if (!string.IsNullOrEmpty(opip))
            {
                LogsListIQ = LogsListIQ.Where(s => s.LogIP.Contains(opip));
            }


            if (!string.IsNullOrEmpty(optime))
            {
后面还有 26 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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