示例#1
0
 private void BtnAddStock_Click(object sender, RoutedEventArgs e)
 {
     if (WhatRole == "Admin" || WhatRole == "Stock Manager")
     {
         StockWindow stoWin = new StockWindow(EmployeeId, null);
         this.Close();
         stoWin.ShowDialog();
     }
     else
     {
         MessageBox.Show("You're NOT allowed");
     }
 }
示例#2
0
        private void BtnDetailStock_Click(object sender, RoutedEventArgs e)
        {
            if (WhatRole == "Admin" || WhatRole == "Stock Manager")
            {
                var selectedStock = dataGridStock.SelectedItem as Kho;
                if (selectedStock == null)
                {
                    MessageBox.Show("Please Choose The Stock");
                    return;
                }

                StockWindow stoWin = new StockWindow(EmployeeId, selectedStock);
                this.Close();
                stoWin.ShowDialog();
            }
            else
            {
                MessageBox.Show("You're NOT allowed");
            }
        }