Example #1
0
        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);
                }
            }
        }
Example #2
0
 private void SetDetails(clsOrder prOrder)
 {
     _Order = prOrder;
     UpdateForm();
     ShowDialog();
 }
Example #3
0
 internal static async Task <string> UpdateOrderAsync(clsOrder prOrder)
 {
     return(await InsertOrUpdateAsync(prOrder, "http://localhost:60064/api/bshop/PutInventory", "PUT"));
 }