コード例 #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));
        }
コード例 #2
0
ファイル: BaseController.cs プロジェクト: rcw0125/crm20200819
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="queryType">查询类型1 多选 0单选</param>
        /// <param name="htmlApproveId">html审批人标记id</param>
        /// <returns></returns>
        public ActionResult QueryUser(int queryType, string htmlApproveId, string htmlApproveName)
        {
            TS_USERDTO           uDto = new TS_USERDTO();
            PageResult <TS_USER> ef   = service.GetUsers(uDto);
            BASEPAGE             page = AUTOMAPING.Mapping <BASEPAGE>(ef);

            this.HttpContext.Session["Page"] = page;
            uDto.Users           = MAPPING.ConvertEntityToDtoList <TS_USER, TS_USERDTO>(ef.DataList);
            uDto.C_QueryType     = queryType;
            uDto.HtmlApproveId   = htmlApproveId;
            uDto.HtmlApproveName = htmlApproveName;
            return(View(uDto));
        }