source/Repid.MvcApplication/Areas/Manage/Controllers/DepartmentController.cs

(开头部分) 2KB

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

using Repid.Entity.Basic;
using Repid.MvcExtension.Controllers;
using Repid.Core.Aop;
using Repid.Utility.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Repid.MvcApplication.Areas.Manage.Controllers
{
    public class DepartmentController : ManageController
    {
        public ActionResult List()
        {
            return View();
        }

        public ActionResult Page(string id, string pid)
        {
            BasicDepartment model;

            if (string.IsNullOrEmpty(id))
            {
                model = new BasicDepartment();

                model.Pid = pid;
            }
            else { model = ServiceFactory.BasicDepartment.Get(id); }

            return View(model);
        }

        public string Grid()
        {
            return JsonHelper.Serialize(ServiceFactory.BasicDepartment.GetAll());
        }

        public string Tree()
        {
            var list = ServiceFactory.BasicDepartment.GetAll();

            var newlist = list.Select(m => new
            {
                id = m.ID,
                text = m.Name,
                pid = m.Pid
            }).ToList();

            newlist.Insert(0, new
            {
                id = "0",
                text = "无父级",
                pid = string.Empty
            });

            return JsonHelper.Serialize(newlist);
        }

后面还有 30 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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