public async void MainForm_Load(object sender, EventArgs e) { lblCash.Text = $"Счёт: {Cash.ToString()} тенге"; lblName.Text = UserName; lblOnUpdating.Text = "Идёт обновление..."; await Task.Run(() => UpdateLine?.Invoke()); lblOnUpdating.Text = string.Empty; this.Fill(); }
public async Task <JObject> Update(UpdateLine postUpdateLine) { try { var distributor = GetDistributorById(postUpdateLine.DistributorId); var inventory = distributor.Inventory; bool updated = false; inventory.ForEach(delegate(Line line) { if (line.Id.Equals(postUpdateLine.OldLineId)) { line = postUpdateLine.NewLine; updated = true; } }); if (updated) { return(await UpdateInventoryList(postUpdateLine.DistributorId, inventory)); } else { return (JObject.FromObject( new { status = "false", result = false, message = "Could not update inventory. Line item in inventory not found." } )); } } catch (Exception ex) { return (JObject.FromObject( new { status = "Exception Thrown", result = false, message = ex.Message } )); } }
private async void UpdateLineAsync(object sender, EventArgs e) { await Task.Run(() => UpdateLine?.Invoke()); }
public IHttpActionResult Update(UpdateLine postUpdateLine) { return(Ok(_lineServiceClient.Update(postUpdateLine))); }
public Task <JObject> Update(UpdateLine postUpdateLine) { return(_inventoryServiceClient.Update(postUpdateLine)); }