public JsonResult ChangeDateMoney(ExtendModel obj) { var datas = new List <ExtendModel>(); if (!string.IsNullOrEmpty(obj.Json)) { datas = JsonConvert.DeserializeObject <List <ExtendModel> >(obj.Json); if (datas != null && datas.Count > 0) { var model = datas.FirstOrDefault(n => n.Id == obj.Id); if (model != null) { if (obj.Type == "1") { model.Money = obj.Money; } else { model.Date = obj.Date; } } } } var str = JsonConvert.SerializeObject(datas); return(Json(str, JsonRequestBehavior.AllowGet)); }
public async Task <IActionResult> Extend(Guid id, [FromBody] ExtendModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await WorkerServices.ExtendJobOrderAsync(id, model); return(Ok()); }
public async Task ExtendJobOrderAsync(Guid jobOrderId, ExtendModel model) { var userId = GetCurrentUserId(); var command = new ExtendJobOrderCommand(userId, jobOrderId, model.NewDueDate, model.Price); await Bus.Send(command); }