Example #1
0
        public GetCorpDepartmentResponseViewModel GetCorpPolicyDepartmentByCorpId(GetCorpDepartmentRequestViewModel request)
        {
            List <CorpDepartmentModel> corpDepartmentModels =
                _getCorpPolicyDepartmentServiceBll.GetCorpPolicyDepartmentByCorpId(request.CorpId, request.PolicyId, request.AduitId);

            GetCorpDepartmentResponseViewModel viewModel = new GetCorpDepartmentResponseViewModel();

            viewModel.DepartmentList =
                Mapper.Map <List <CorpDepartmentModel>, List <CorpPolicyDepartmentViewModel> >(corpDepartmentModels);
            return(viewModel);
        }
        public async Task <ResponseBaseViewModel <GetCorpDepartmentResponseViewModel> > GetCorpPolicyDepartments(
            [FromBody] GetCorpDepartmentRequestViewModel request)
        {
            request.Cid = this.GetCid();
            GetCorpDepartmentResponseViewModel viewModel = new GetCorpDepartmentResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _getCorpPolicyDepartmentApplication.GetCorpPolicyDepartmentByCorpId(request);
            });

            ResponseBaseViewModel <GetCorpDepartmentResponseViewModel> v = new ResponseBaseViewModel
                                                                           <GetCorpDepartmentResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }