private void tsbProduct_Click(object sender, EventArgs e) { var userAccess = userAccessRepository.GetAll(); bool isAllowed = userAccess.Exists(u => u.FullName == Store.ActiveUser && u.ObjectName == "Barang" && u.IsOpen); if (isAllowed || Store.IsAdministrator) { var frmProduct = new ProductUI(this); frmProduct.MdiParent = this; frmProduct.Show(); } else { MessageBox.Show("Anda tidak dapat membuka form ini", "Perhatian", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public ProductQtyUpdateUI(ProductUI frmProduct) { this.frmProduct = frmProduct; InitializeComponent(); productQtyRepository = ServiceLocator.GetObject <IProductQtyRepository>(); }