Controllers/I1/I0103Controller.cs

(开头部分) 6KB

这里只显示每个文件的开头 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;

namespace OPMS.Controllers
{
    public class I0103Controller : BaseController
    {
        private DBHelp db = new DBHelp();

        // GET: /I0103/
        public ActionResult Index(string DCode = "", string queryStr = null)
        {
            GetPCodeDrp(0);
            IQueryable<I0103> list=db.I0103.Include(i=>i.i0102);
            if (DCode == "0")
                list = list.Where(p => p.DCode == null);
            else if (DCode != "0" && DCode!="")
                list = list.Where(p => p.DCode == DCode);
            if (!string.IsNullOrEmpty(queryStr))
            {
                //关键字查询
                list = list.Where(p => p.Position.Contains(queryStr));
            }
            ViewBag.queryStr = queryStr;
            return View(list.OrderBy(t => t.Sort));
        }
        //
        // GET: /I0103/Details/5

        public ActionResult Details(int id = 0)
        {
            I0103 i0103 = db.I0103.Find(id);
            if (i0103 == null)
            {
                return HttpNotFound();
            }
           i0103.DCode = i0103.DCode + ":" + GetPCode(i0103.DCode);
           return View(i0103);
        }
        private string GetPCode(string ff)
        {
            string Sql = "select a.DeptName from I0102 a where a.DCode='" + ff + "'";
            var name = db.Database.SqlQuery<String>(Sql).ToList();
            if (name == null || name[0] == null)
            { return ""; }
            return name[0];
        }
        #region Create
        public ActionResult Create(string id)
        {
            GetPCodeDrp(1);
            I0103 i0103 = new I0103();
            i0103.DCode = id;
            return View(i0103);
后面还有 125 行代码,购买后查看完整代码

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

AI 解读

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

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