Ejemplo n.º 1
0
        private void InitializeButtons()
        {
            string     frmName = this.GetType().Name;
            frmLihatSJ frm     = (frmLihatSJ)this.Owner;

            frm.GetPermissions(out add_, out edit_, out delete_);
        }
Ejemplo n.º 2
0
        private void mainradMenu_Click(object sender, EventArgs e)
        {
            string menuText = string.Empty;
            string MenuName = string.Empty;
            string Menu     = string.Empty;

            if (sender is RadMenuItem)
            {
                RadMenuItem item = (RadMenuItem)sender;
                menuText = item.Text.Replace("&", "");
                MenuName = (item.Tag != null?item.Tag.ToString():"");
                RadForm frm = new RadForm();
                string  tipe;
                switch (MenuName)
                {
                case "":
                    NBConfig.bLoggedIn = false;
                    helper.SysLog(this.GetType().Name, NBConfig.ValidUserName, "Logout");
                    //this.Owner.Show();
                    this.Close();
                    break;

                case "frmInputLP":
                    //get tipe
                    menuText = menuText.Split('.')[1];
                    tipe     = menuText.Replace("Input", "");
                    tipe     = tipe.Trim();
                    frm      = new frmInputLP(tipe);
                    break;

                case "frmInputTMR":
                    menuText = menuText.Split('.')[1];
                    frm      = new frmInputTMR(menuText, true);
                    break;

                case "frmLihatTotal":
                    menuText = menuText.Split('.')[1];
                    frm      = new frmLihatTotal(menuText.ToLower().Replace("stock ", ""));
                    break;

                case "frmLihatSJ":
                    menuText = menuText.Split('.')[1];
                    tipe     = menuText.Replace("Lihat SJ", "");
                    tipe     = tipe.Trim();
                    frm      = new frmLihatSJ(tipe);
                    break;

                case "frmLihatTM":
                    menuText = menuText.Split('.')[1];
                    tipe     = menuText.Replace("Lihat Transaksi", "");
                    tipe     = tipe.Trim();
                    frm      = new frmLihatTM(tipe);
                    break;

                case "frmLihatNR":
                    menuText = menuText.Split('.')[1];
                    tipe     = menuText.Replace("Check", "");
                    tipe     = tipe.Trim();
                    frm      = new frmLihatNR(tipe);
                    break;

                case "frmInputIntern":
                    menuText = menuText.Split('.')[1];
                    frm      = new frmInputIntern(menuText, true);
                    break;

                default:
                    SetForm(MenuName, out frm);
                    break;
                }
                if (!string.IsNullOrEmpty(MenuName))
                {
                    Menu            = item.Text.Split('.')[1];
                    frm.Tag         = Menu;
                    frm.MaximizeBox = false;
                    frm.MinimizeBox = false;
                    frm.FormElement.TitleBar.TitlePrimitive.Font = new System.Drawing.Font("Lucida Bright", 12, FontStyle.Bold);
                    frm.StartPosition = FormStartPosition.CenterParent;
                    frm.ShowDialog(this);
                }
            }
        }