Beispiel #1
0
        private void BtnOrder_Click(object sender, RoutedEventArgs e)
        {
            OrderRequest or   = new OrderRequest();
            int          num  = or.GenerateNum();
            bool         flag = false;

            foreach (MedicalSupply item in cartList)
            {
                or = new OrderRequest(num, item.SupplyId, Login.userId);
                or.SetDrone(drone.DroneID);
                or.SetGeoLocaton(currentLoc);
                flag = or.InsertOrderRequests(or);

                if (!flag)
                {
                    notifier.error("Error Placing Order");
                }
            }

            if (flag)
            {
                notifier.success("Order Placed Succesfully");
                cartList.Clear();
                txtCart.Clear();
                lblTotal.Content = "";
            }

            MainWindow main = new MainWindow();

            Content = main;
        }