Controllers/I1/I0105Controller.cs

(开头部分) 28KB

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

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OPMS.Models;
using OPMS.Common;
using System.IO;

namespace OPMS.Controllers
{

    public class I0105Controller : BaseController
    {
        private DBHelp db = new DBHelp();

        // GET: /I0105/
        public ActionResult Index(string DCode = null, int cstate = 1, string queryStr = null, int pageIndex = 1)
        {
            if (DCode == null)
            {
                DCode = CurrentUserInfo.DCode;
            }
            List<I0102> bmlist = db.I0102.ToList();
            //获取一级部门
            List<SelectListItem> vParentIDlist = bmlist.Where(con => con.PCode == null).OrderBy(t => t.ALevel).ToList().Select(c => new SelectListItem() { Text = c.DeptName, Value = c.DCode.ToString(), Selected = (c.DCode == DCode) }).ToList();//将实体集合 转成 SelectListItem集合 
            vParentIDlist.Add((new SelectListItem { Text = "--全部--", Value = "0", Selected = (DCode == "0") }));
            ViewBag.APCode = vParentIDlist;

            IQueryable<I0105> list = db.I0105.Include(i => i.i0102).Include(i => i.i0103).Include(i => i.i0502).Where(t => t.Inauguration == cstate);
            if (DCode != "0")
            {
                list = list.Where(t => t.DCode.Contains(DCode));
            }
            if (!string.IsNullOrEmpty(queryStr))
            {
                list = list.Where(t => t.Name.Contains(queryStr) || t.Number.ToString().Contains(queryStr));
            }

            int pageSize = 20;
            int totalCount = list.Count();
            List<I0105> Data = list.OrderBy(t => t.Number).ThenBy(t => t.DCode).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
            foreach (I0105 I0105 in Data)
            {
                List<I0102> info = bmlist.Where(t => t.Leader == I0105.Number).ToList();
                if (info.Count > 0)
                {
                    if (string.IsNullOrEmpty(info[0].PCode))
                        I0105.Name = I0105.Name + " [部门领导]";
                    else
                        I0105.Name = I0105.Name + " [分组负责人]";

                    if (info[0].DCode != I0105.DCode)
                    {
                        I0105.Name = I0105.Name + "(非本部门)";
                    }
                }
                string codeStr = string.Empty;
后面还有 591 行代码,购买后查看完整代码

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

AI 解读

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

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