private async void btnDeleteOrder_Click(object sender, EventArgs e) { int lcIndex = lstBoxOrder.SelectedIndex; if (lcIndex >= 0 && MessageBox.Show("are you sure?", "deleting order", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { clsOrder lcOrder = lstBoxOrder.SelectedValue as clsOrder; MessageBox.Show(await ServiceClient.DeleteOrderAsync(lcOrder.orderID)); refreshFormFromDB(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\n" + ex.StackTrace); } } }
private void SetDetails(clsOrder prOrder) { _Order = prOrder; UpdateForm(); ShowDialog(); }
internal static async Task <string> UpdateOrderAsync(clsOrder prOrder) { return(await InsertOrUpdateAsync(prOrder, "http://localhost:60064/api/bshop/PutInventory", "PUT")); }