Example #1
0
        public async Task <ApiResult <bool> > UpdateProcessPlanCensorship(UpdateCensorship bundle)
        {
            var json        = JsonConvert.SerializeObject(bundle);
            var httpContent = new StringContent(json, Encoding.UTF8, "application/json");
            var url         = $"/api/ProcessPlan/censorship";
            var result      = await Update <bool>(url, httpContent);

            return(result);
        }
        public async Task <IActionResult> Update([FromBody] UpdateCensorship bundle)
        {
            var result = await _processPlanService.UpdateProcessPlanCensorship(bundle);

            if (result.IsSuccessed)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }
Example #3
0
        public async Task <ApiResult <bool> > UpdateProcessPlanCensorship(UpdateCensorship bundle)
        {
            var process = await _context.ProcessPlans.FindAsync(bundle.Id);

            if (process == null)
            {
                return(new ApiErrorResult <bool>("Kế hoạch không tồn tại"));
            }
            var au = await _userManager.FindByNameAsync(bundle.Authority);

            process.IdAuthority = au.Id;
            process.Censorship  = true;

            _context.ProcessPlans.Update(process);
            await _context.SaveChangesAsync();

            return(new ApiSuccessResult <bool>());
        }
        public async Task <IActionResult> UpdateProcessPlanCensorship(UpdateCensorship bundle)
        {
            var result = await _processPlanApiClient.UpdateProcessPlanCensorship(bundle);

            return(Ok(result));
        }