Example #1
0
 private void GetSubMenu(ToolStripMenuItem current)
 {
     foreach (Object item in current.DropDownItems)
     {
         if (item is ToolStripMenuItem)
         {
             ToolStripMenuItem menu = (ToolStripMenuItem)item;
             if (!SecurityManager.IsManager() && !SecurityManager.IsAdministrator())
             {
                 CheckMenuAuthorization(menu);
             }
             GetSubMenu(menu);
         }
     }
 }
Example #2
0
        private void fmMain_Load(object sender, EventArgs e)
        {
            GlobalVar.initialize();
            timer1.Enabled = true;
            timer1.Start();
            if (!SecurityManager.IsManager())
            {
                PerformSecurityCheck();
            }
            tsUserID.Text     = "User ID: " + SecurityManager.UserID + "/" + GlobalVar.PerusahaanID;
            tsHost.Text       = "Host: " + ISA.DAL.Database.Host + " (" + GlobalVar.CabangID + ")";
            tsServerDate.Text = "Tanggal : " + string.Format("{0:dd-MMM-yyyy}", GlobalVar.GetServerDate);
            tsPerusahaan.Text = GlobalVar.PerusahaanName;
            Version v     = Assembly.GetExecutingAssembly().GetName().Version;
            string  About = string.Format(CultureInfo.InvariantCulture, @"Version: {0}.{1}.{2} (r{3})", v.Major, v.Minor, v.Build, v.Revision);

            tsVer.Text = About;

            if (GlobalVar.CabangID.Contains("06A"))
            {
                perubahanBBNToolStripMenuItem.Enabled      = false;
                perubahanBBNToolStripMenuItem.Visible      = false;
                leasingToolStripMenuItem1.Enabled          = true;
                leasingToolStripMenuItem1.Visible          = true;
                customerBlacklistToolStripMenuItem.Enabled = true;
                customerBlacklistToolStripMenuItem.Visible = true;
            }
            else
            {
                perubahanBBNToolStripMenuItem.Enabled      = false;
                perubahanBBNToolStripMenuItem.Visible      = false;
                leasingToolStripMenuItem1.Enabled          = false;
                leasingToolStripMenuItem1.Visible          = false;
                customerBlacklistToolStripMenuItem.Enabled = false;
                customerBlacklistToolStripMenuItem.Visible = false;
            }

            if (GlobalVar.CabangID.Contains("06"))
            {
                JualToolStripMenuItem.Visible = false;
                JualToolStripMenuItem.Enabled = false;
            }
            else
            {
                stokMotorBaruToolStripMenuItem.Visible        = false;
                stokMotorBaruToolStripMenuItem.Enabled        = false;
                pembelianBaruToolStripMenuItem.Visible        = false;
                pembelianBaruToolStripMenuItem.Enabled        = false;
                penjualanBaruToolStripMenuItem.Visible        = false;
                penjualanBaruToolStripMenuItem.Enabled        = false;
                uMBungaToolStripMenuItem.Visible              = false;
                uMBungaToolStripMenuItem.Enabled              = false;
                uMSubsidiToolStripMenuItem.Visible            = false;
                uMSubsidiToolStripMenuItem.Enabled            = false;
                perubahanSistemBayarToolStripMenuItem.Visible = false;
                perubahanSistemBayarToolStripMenuItem.Enabled = false;
                penjualanBekasToolStripMenuItem.Visible       = false;
                penjualanBekasToolStripMenuItem.Enabled       = false;
            }
            saldoUangMukaToolStripMenuItem.Visible = false;
            saldoUangMukaToolStripMenuItem.Enabled = false;

            generateKetTagih();
        }