Exemple #1
0
        private void DoBuyMaterial(object sender, RoutedEventArgs e)
        {
            int id;

            Int32.TryParse(idText.Text, out id);

            if (ConnectionController.GetInstance().HeaderFundRequests.Where(x => x.Id.Equals(id) && x.ResponseStatus.Equals("Approved")).FirstOrDefault() != null)
            {
                PurchaseRequestController.DoBuyMaterial(id);
                MessageBox.Show("Material Bought");
            }
            else
            {
                MessageBox.Show("Sorry, you can only buy approved material");
            }

            PurchaseHomePage purchaseHomePage = new PurchaseHomePage();

            this.NavigationService.Navigate(purchaseHomePage);
        }
Exemple #2
0
        private void DoRequest(object sender, RoutedEventArgs e)
        {
            int money;

            Int32.TryParse(moneyPrice.Text, out money);

            if (!moneyPrice.Text.Equals(""))
            {
                RequestItemController.DoFundRequest(money, reasonDescText.Text, true);
                PurchaseHomePage purchaseHomePage = new PurchaseHomePage();
                this.NavigationService.Navigate(purchaseHomePage);
            }
            else
            {
                RequestItemController.DoFundRequest(money, reasonDescText.Text, false);
                RequestItemPage requestItemPage = new RequestItemPage();
                this.NavigationService.Navigate(requestItemPage);
            }
            MessageBox.Show("Your request has been sent !");
        }