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"); } }
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"); } }