QiFeng.ZWY.MagWeb/Controllers/TravelController.cs

(开头部分) 10KB

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

using QiFeng.LMSD.Bll;
using QiFeng.LMSD.Model.EnumModel;
using QiFeng.LMSD.Utility;
using QiFeng.LMSD.Utility.EnumTools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebGrease.Css.Extensions;

namespace QiFeng.LMSD.MagWeb.Controllers
{
    public class TravelController : BaseController
    {
        private readonly TravelsBll travelsBll = new TravelsBll();
        private readonly ConsumerBll consumerBll = new ConsumerBll();
        public readonly TravelsCommentsBll travelsCommentsBll = new TravelsCommentsBll();
        #region 游记管理
        /// <summary>
        /// 游记列表
        /// </summary>
        /// <returns></returns>
        public ActionResult TravelList()
        {
            var enumSaveType = EnumUtil.GetEnumDescriptions(typeof(TravelsSavaType));
            List<SelectListItem> enumSaveTypeList = new List<SelectListItem>();
            foreach (var item in enumSaveType)
            {
                enumSaveTypeList.Add(new SelectListItem() { Text = item.Value, Value = item.Key });
            }
            ViewData["enumSaveType"] = new SelectList(enumSaveTypeList, "Value", "Text");

            var enumAuditStatus = EnumUtil.GetEnumDescriptions(typeof(AuditStatus));
            List<SelectListItem> enumAuditStatusList = new List<SelectListItem>();
            foreach (var item in enumAuditStatus)
            {
                enumAuditStatusList.Add(new SelectListItem() { Text = item.Value, Value = item.Key });
            }
            ViewData["enumAuditStatus"] = new SelectList(enumAuditStatusList, "Value", "Text");
            return View();
        }
        [HttpPost]
        public JsonResult GetTravelList(int draw, int start, int length, string auditStatus, string userName, string saveType)
        {
            int order;
            int.TryParse(Request["order[0][column]"], out order);
            var direction = Request["order[0][dir]"];
            var orderByColumns = new[] { "UserName", "strDate", "TravelsTitle", "enumSaveType", "enumAuditStatus" };
            var search = Request["search[value]"];
            var pageIndex = start / length + 1;

            var theList = travelsBll.GetListByPage(draw, pageIndex, length, SqlSafe(search), orderByColumns[order] + " " + direction, auditStatus, userName, saveType);
            if (theList != null)
            {
                var allowedModules = McModuleList;
                if (allowedModules != null)
                {
                    foreach (var item in theList.data)
                    {
后面还有 210 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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