QiFeng.ZWY.MagWeb/Controllers/AdvertiseController.cs

(开头部分) 17KB

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

using QiFeng.LMSD.Bll;
using QiFeng.LMSD.Bll.BllExt;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Utility.Files;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;

namespace QiFeng.LMSD.MagWeb.Controllers
{
    public class AdvertiseController : BaseController
    {
        private readonly AdvertisementsBll advertisementsBll = new AdvertisementsBll();
        private readonly AdvertiseTypeBll advertiseTypeBll = new AdvertiseTypeBll();
        private readonly string ImgFileSitePath = ConfigurationManager.AppSettings["ImgFileSitePath"];
        private readonly string _imgFileUploadPath = ConfigurationManager.AppSettings["ImgFileUploadPath"];
        private readonly AdvertiseExtBll advertiseExtBll = new AdvertiseExtBll();
        /// <summary>
        /// 广告列表
        /// </summary>
        /// <returns></returns>
        [PermissionFilter]
        public ActionResult AdvertiseList()
        {
            var list = advertiseTypeBll.GetModelList();
            ViewData["list"] = new SelectList(list, "Id", "TypeName");
            return View();
        }
        [HttpPost]
        public JsonResult GetAdvertiseList(int draw, int start, int length, string type, string beginTime, string endTime)
        {
            int order;
            int.TryParse(Request["order[0][column]"], out order);
            var direction = Request["order[0][dir]"];
            var orderByColumns = new[] { "Title", "TypeName", "Link", "FileAddress", "strIsTop", "strBeginTime", "strEndTime" };
            var search = Request["search[value]"];
            var pageIndex = start / length + 1;

            var theList = advertisementsBll.GetListByPage(draw, pageIndex, length, SqlSafe(search), orderByColumns[order] + " " + direction, type, beginTime, endTime);
            if (theList != null)
            {
                var allowedModules = McModuleList;
                if (allowedModules != null)
                {
                    foreach (var item in theList.data)
                    {
                        if (allowedModules != null || CurrentUser.IsMagAccount)
                        {
                            item.Link = "<a href=" + item.Link + " herf = '" + item.Link + "'>" + item.Link + "</a>";
                            item.FileAddress = "<img src=" + ImgFileSitePath + item.FileAddress + " name ='img' id='img' height='50' width='50' style='margin-right:5px;' /><br />";
                            if (CurrentUser.IsMagAccount || allowedModules.Any(u => u.Action == "UpdateAdvertise" && u.Controller == "Advertise"))
                                item.Action += "<a class='btn btn-danger' href='javascript:;' onclick=updateData(" + item.Id + ");>修改</a>";
                            if (CurrentUser.IsMagAccount || allowedModules.Any(u => u.Action == "DeleteAdvertise" && u.Controller == "Advertise"))
                                item.Action += "<a class='btn btn-danger' href='javascript:;' onclick=deleteData(" + item.Id + ");>删除</a>";
                        }
后面还有 382 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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