示例#1
0
        public ActionResult Relation(TS_CUSTFILEDTO cfDto)
        {
            //关联客户档案
            if (cfDto.OperationType == 1)
            {
                string msg    = "";
                int    result = service.Relation(cfDto, out msg);
                //获取数据字典列表
                PageResult <TS_CUSTFILE> ef = basicsService.GetCustFiles(cfDto);
                //获取分页数据
                BASEPAGE page = AUTOMAPING.Mapping <BASEPAGE>(ef);
                this.HttpContext.Session["Page"] = page;
                //EF实体数据转换为DTO
                cfDto.CustFiles = MAPPING.ConvertEntityToDtoList <TS_CUSTFILE, TS_CUSTFILEDTO>(ef.DataList);
                if (result == 1)
                {
                    cfDto.ResultType = 1;
                }
                else
                {
                    cfDto.ResultType = 2;
                }

                cfDto.Msg = msg;

                return(View(cfDto));
            }
            else
            {
                //获取数据字典列表
                PageResult <TS_CUSTFILE> ef = basicsService.GetCustFiles(cfDto);
                //获取分页数据
                BASEPAGE page = AUTOMAPING.Mapping <BASEPAGE>(ef);
                this.HttpContext.Session["Page"] = page;
                //EF实体数据转换为DTO
                cfDto.CustFiles = MAPPING.ConvertEntityToDtoList <TS_CUSTFILE, TS_CUSTFILEDTO>(ef.DataList);
                return(View(cfDto));
            }
        }