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));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Extend(Guid id, [FromBody] ExtendModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await WorkerServices.ExtendJobOrderAsync(id, model);

            return(Ok());
        }
Ejemplo n.º 3
0
 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);
 }