コード例 #1
0
        public AddCorpAduitProjectRelationResponseViewModel AddCorpAduitProjectRelation(
            AddCorpAduitProjectRelationRequestViewModel request)
        {
            CorpAduitConfigProjectModel query = new CorpAduitConfigProjectModel()
            {
                AduitId = request.AduitId
            };

            if (request.ProjectIdList != null)
            {
                query.ProjectIdList = new List <KeyValueModel <int, bool> >();
                foreach (var keyValueViewModel in request.ProjectIdList)
                {
                    query.ProjectIdList.Add(new KeyValueModel <int, bool>()
                    {
                        Key   = keyValueViewModel.Key,
                        Value = keyValueViewModel.Value
                    });
                }
            }

            bool flag =
                _addCorpAduitProjectRelationServiceBll.AddCorpAduitProjectRelation(query);

            return(new AddCorpAduitProjectRelationResponseViewModel()
            {
                IsSuccessed = flag
            });
        }
コード例 #2
0
        public async Task <ResponseBaseViewModel <AddCorpAduitProjectRelationResponseViewModel> > AddCorpAduitProjectRelation(
            [FromBody] AddCorpAduitProjectRelationRequestViewModel request)
        {
            request.Cid = this.GetCid();
            AddCorpAduitProjectRelationResponseViewModel viewModel = new AddCorpAduitProjectRelationResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _addCorpAduitProjectRelationApplication.AddCorpAduitProjectRelation(request);
            });

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

            return(v);
        }