コード例 #1
0
        private void btnAddNewItemToInventory_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (UserAccessLevel.getInstance().gsCurrentUserAccessLevel == "Admin")
                {
                    _ItemAdder.ShowDialog();
                }
                else
                {
                    MessageBoxResult result;
                    result = MessageBox.Show("You are NOT logged in as an Administrator and Therefore Have No Permission To Add " +
                                             " Items to The Inventory. Click OK To Retry Login or Cancel To Quit", "Access Denied",
                                             MessageBoxButton.OKCancel, MessageBoxImage.Hand);

                    if (result == MessageBoxResult.OK)
                    {
                        new LoginWindow().ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
 private void btnProceedeToCheckout_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (UserAccessLevel.getInstance().gsCurrentUserAccessLevel != string.Empty)
         {
             double total;
             double.TryParse(txtblkReceiptTotalPrice.Text, out total);
             _Checkout.gsTotal      = total;
             _Checkout.gsNames      = receiptItemsNames;
             _Checkout.gsPrices     = receiptItemsPrice;
             _Checkout.gsQuantities = receiptItemsQty;
             _Checkout.ShowDialog();
         }
         else
         {
             MessageBoxResult result = MessageBox.Show("You are NOT logged in as an Administrator and Therefore Have No Permission To Sell " +
                                                       " Items. Click OK To Retry Login or Cancel To Quit", "Access Denied",
                                                       MessageBoxButton.OKCancel, MessageBoxImage.Hand);
             if (result == MessageBoxResult.OK)
             {
                 new LoginWindow().ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            if (checkCredentials(txtbxUsername.Text, txtbxPassword.Password, ref accessLevel) == true)
            {
                UserAccessLevel.getInstance().gsCurrentUserAccessLevel = accessLevel;
                UserAccessLevel.getInstance().gsCurrentUserName        = currentUser;

                this.Close();
            }
            else
            {
                MessageBox.Show("The Credentials Entered Did NOT Match, Please Revise and Try Again", "Login Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
コード例 #4
0
 private void InventoryEditorUI_Activated(object sender, EventArgs e)
 {
     userStatus = UserAccessLevel.getInstance().gsCurrentUserAccessLevel;
 }
コード例 #5
0
 private void InventoryEditorUI_GotFocus(object sender, RoutedEventArgs e)
 {
     userStatus = UserAccessLevel.getInstance().gsCurrentUserAccessLevel;
 }