private void btnOutletTypes_Click(object sender, EventArgs e) { if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.MasterData.OutletType))) { CommonMessageHelper.NoAccess(); return; } OpenChildForm(new FrmOutletType(), sender); }
private void btnExportPelanggan_Click(object sender, EventArgs e) { if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.MasterData.Customer))) { CommonMessageHelper.NoAccess(); return; } FrmCustomerRecap frmCustomerRecap = new FrmCustomerRecap(); frmCustomerRecap.ShowDialog(); }
private void btnExportExcel_Click(object sender, EventArgs e) { if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.Reporting.Sales))) { CommonMessageHelper.NoAccess(); return; } FrmInvoiceRecap frmInvoiceRecap = new FrmInvoiceRecap(); frmInvoiceRecap.ShowDialog(); }
private void backupDatabaseToolStripMenuItem_Click(object sender, EventArgs e) { // Only Super Admin can do the backup using (var context = new CisDbContext()) { var userRole = new UnitOfWork <UserRole>(context).Repository.GetAll() .Where(u => u.UserId == Properties.Settings.Default.CurrentUserId).FirstOrDefault(); var isSuperAdmin = new UnitOfWork <Role>(context).Repository.GetAll() .Where(r => r.Id == userRole.RoleId && r.RoleCode == "SUPER").FirstOrDefault() != null; if (!isSuperAdmin) { CommonMessageHelper.NoAccess(); return; } FrmBackupDatabase frmBackupDatabase = new FrmBackupDatabase(); frmBackupDatabase.ShowDialog(); } }