public ActionResult Edit(int Id)
        {
            BLL.EmployeeMiddleBLL mybll = new EmployeeMiddleBLL();
            EmployeeMiddleShow    Model = mybll.GetDataByID(Id);

            ViewBag.EmployeeMiddleShow = Model;
            return(View());
        }
 public EmployeeMiddleApiController(EmployeeMiddleBLL bll)
 {
     m_BLL = bll;
 }
        string menuId = "1041";   // 菜单“费用中间表管理”

        /// <summary>
        /// 异步加载数据
        /// </summary>
        /// <param name="getParam"></param>
        /// <returns></returns>
        public Common.ClientResult.DataResult PostData([FromBody] GetDataParam getParam)
        {
            BLL.EmployeeMiddleBLL mybll = new EmployeeMiddleBLL();
            int total = 0;

            int    yearMonth   = 0;
            int    companyId   = 0;
            int    insuranceId = 0;
            string certificate = "";
            string name        = "";

            // 各搜索项赋值
            Expression <Func <EmployeeMiddleShow, bool> > where = u => true;
            if (!string.IsNullOrEmpty(getParam.search))
            {
                string[] search = getParam.search.Split('^');
                if (search[0].Split('&')[1] != "")
                {
                    string start = search[0].Split('&')[1].Replace("-", "");
                    yearMonth = Convert.ToInt32(start);
                }
                if (search[1].Split('&')[1] != "" && search[1].Split('&')[1] != "null" && search[1].Split('&')[1] != "0")
                {// 公司
                    companyId = Convert.ToInt32(search[1].Split('&')[1]);
                }
                if (search[2].Split('&')[1] != "")
                {// 种类
                    insuranceId = Convert.ToInt32(search[2].Split('&')[1]);
                }
                // 身份证号
                certificate = search[3].Split('&')[1];
                // 员工姓名
                name = search[4].Split('&')[1];
            }

            #region 获取权限配置
            //部门范围权限
            int    departmentScope = base.MenuDepartmentScopeAuthority(menuId);
            string departments     = "";

            if (departmentScope == (int)DepartmentScopeAuthority.无限制)//无限制
            {
                //部门业务权限
                departments = MenuDepartmentAuthority(menuId);
            }
            #endregion

            List <EmployeeMiddleShow> queryData = mybll.GetData(getParam.page, getParam.rows, out total, yearMonth, companyId, insuranceId, certificate, name,
                                                                departmentScope, departments, LoginInfo.BranchID, LoginInfo.DepartmentID, LoginInfo.UserID);
            var data = new Common.ClientResult.DataResult
            {
                total = total,
                rows  = queryData.Select(s => new
                {
                    EmployeeId   = s.EmployeeId,
                    EmployeeName = s.EmployeeName,
                    CardId       = s.CardId,
                    CompanyId    = s.CompanyId,
                    CompanyName  = s.CompanyName,
                    CompanyEmployeeRelationId = s.CompanyEmployeeRelationId,
                    InsuranceKindId           = s.InsuranceKindId,
                    InsuranceKindName         = Enum.GetName(typeof(Common.CostType), s.InsuranceKindId),
                    Id                  = s.Id,
                    PaymentBetween      = s.PaymentBetween,
                    PaymentStyle        = s.PaymentStyle,
                    PaymentStyleName    = Enum.GetName(typeof(Common.EmployeeMiddle_PaymentStyle), s.PaymentStyle),
                    CompanyBasePayment  = s.CompanyBasePayment,
                    CompanyPayment      = s.CompanyPayment,
                    EmployeeBasePayment = s.EmployeeBasePayment,
                    EmployeePayment     = s.EmployeePayment,
                    PaymentMonth        = s.PaymentMonth,
                    StartDate           = s.StartDate,
                    EndedDate           = s.EndedDate,
                    UseBetween          = s.UseBetween,
                    Remark              = s.Remark,
                    State               = s.State,
                    CreateTime          = s.CreateTime,
                    CreatePerson        = s.CreatePerson,
                    UpdateTime          = s.UpdateTime,
                    UpdatePerson        = s.UpdatePerson,
                    CityId              = s.CityId
                })
            };
            return(data);
        }