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 }); }
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); }