Controllers/PersonController.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class PersonController : Controller
    {
        private readonly DataDbcontext _context;

        public PersonController(DataDbcontext context)
        {
            this._context = context;
        }
        // GET: Inventory
        public ActionResult Index(string findstr)
        {
            if (findstr == null)
            {
                if (Request.Form["findstr"].ToString() == null)
                {
                    return View();
                }
                else
                {
                    findstr = Request.Form["findstr"].ToString();
                }
            }


            var lists = _context.hr_hi_person.Join(_context.department, per => per.cDept_num, dpt => dpt.cdepcode, (per, dpt) => new hr_hi_person
            {
                cDepName= dpt.cdepname,
                cDept_num=per.cDept_num,
                cPsn_name=per.cPsn_name,
                cPsn_Num=per.cPsn_Num,
                rEmployState=per.rEmployState
            }).Where(q => q.rEmployState=="10" &&(q.cDepName.ToLower().Contains(findstr.ToLower()) || q.cPsn_name.ToLower().Contains(findstr.ToLower()) || q.cPsn_Num.ToLower().Contains(findstr.ToLower()))).ToList();

            return View(lists);
        }

        // GET: Person/Details/5
        public ActionResult Details(int id)
        {
            return View();
        }

        // GET: Person/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Person/Create
        [HttpPost]
后面还有 62 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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