コード例 #1
0
        private void btnOutletTypes_Click(object sender, EventArgs e)
        {
            if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.MasterData.OutletType)))
            {
                CommonMessageHelper.NoAccess();
                return;
            }

            OpenChildForm(new FrmOutletType(), sender);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: FrmMain.cs プロジェクト: iwayz/CisWindowsApp
        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();
            }
        }