コード例 #1
0
        public ActionResult UserManage()
        {
            TS_USERDTO dto = new TS_USERDTO();
            //获取完成工差列表
            PageResult <TS_USER> ef = service.GetUsers(dto, 1);
            //获取分页数据
            BASEPAGE page = AUTOMAPING.Mapping <BASEPAGE>(ef);

            this.HttpContext.Session["Page"] = page;
            //EF实体数据转换为DTO
            dto.Users = MAPPING.ConvertEntityToDtoList <TS_USER, TS_USERDTO>(ef.DataList);
            //获取客户档案
            foreach (var item in dto.Users)
            {
                if (item.C_CUST_ID != null)
                {
                    item.CustFile = basicsService.GetCustFile(item.C_CUST_ID);
                }
                else
                {
                    item.CustFile = new TS_CUSTFILE();
                }
            }
            //角色列表
            dto.Roles = basicsService.GetRoleDropDown();
            //获取部门
            dto = service.GetDept(dto);
            return(View(dto));
        }