Controllers/EmpController.cs

(开头部分) 4KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XXX公司积分评比系统.Models;
using System.Data;

namespace XXX公司积分评比系统.Controllers
{
    public class EmpController : Controller
    {
        /// <summary>
        /// 员工管理 按员工名,部门编号
        /// </summary>
        /// <returns></returns>

        public ActionResult Index(string namekey, int? bm, string sex)
        {

            string sql = "select * from '部门' order by Id desc";
            DataTable tab = SQLiteHelper.GetDataTable(sql);

            //获取其它数据
            ViewData["namekey"] = namekey;
            ViewData["bm"] = bm.HasValue ? bm.Value.ToString() : "";
            ViewData["bmlist"] = tab;//
            /////////////////////
            string sql2 = @"SELECT  '员工'.Id as yID,  * from  '员工' inner join 部门  on '员工'.所属部门编号='部门'.ID where 1=1 ";
            if (!string.IsNullOrEmpty(namekey))
            {
                sql2 += " and  员工姓名 like '%" + namekey + "%' ";
            }
            if (!string.IsNullOrEmpty(sex))
            {
                sql2 += " and  员工性别='" + sex + "'";
            }
            if (bm.HasValue && bm.Value != -1)
            {
                sql2 += " and '部门'.Id=" + bm.Value;
            }
            sql2 += " order by '员工'.Id  desc";
            DataTable tab2 = SQLiteHelper.GetDataTable(sql2);
            /////////////////////////////
            return View(tab2);

        }

        #region 增加 视图
        public ActionResult Add()
        {
            //读取部门数据
            string sql = "select * from '部门' order by Id desc";
            DataTable tab = SQLiteHelper.GetDataTable(sql);
            ViewData["bmlist"] = tab;//

            return View();
        }

        /// <summary>
后面还有 78 行代码,购买后查看完整代码

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

AI 解读

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

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