public async Task <ApiResult <GetOrderPlan> > Update(UpdateOrderPlan bundle) { var json = JsonConvert.SerializeObject(bundle); var httpContent = new StringContent(json, Encoding.UTF8, "application/json"); var url = $"/api/OrderPlan/"; var result = await Update <GetOrderPlan>(url, httpContent); return(result); }
public async Task <IActionResult> Update(UpdateOrderPlan bundle) { var resultId = await _orderPlanService.Update(bundle); if (resultId.IsSuccessed) { var result = await _orderPlanService.GetOrderPlan(resultId.ResultObj); return(Ok(result)); } return(BadRequest(resultId)); }
public async Task <ApiResult <long> > Update(UpdateOrderPlan bundle) { var order = await _context.OrderPlans.FindAsync(bundle.Id); order.Name = bundle.Name; order.Note = bundle.Note; order.IdResponsible = bundle.IdResponsible; order.ExpectedDate = bundle.ExpectedDate; _context.OrderPlans.Update(order); await _context.SaveChangesAsync(); return(new ApiSuccessResult <long>(order.Id)); }
public async Task <IActionResult> Update(UpdateOrderPlan bundle) { var result = await _orderPlanApiClient.Update(bundle); return(Ok(result)); }