public frmUtility(clsUsers _user, myPosWide poswide) { InitializeComponent(); m_user = _user; m_POS = poswide; m_winUserInfo.MdiParent = this; m_winQuery.MdiParent = this; m_winSetup = new frmSetup(m_user); m_winSetup.MdiParent = this; m_winSalesReport.MdiParent = this; m_winProdSalesReport.MdiParent = this; m_winProdInventory = new frmInventory(m_user.UserName); m_winProdInventory.MdiParent = this; m_winProdInfo.MdiParent = this; m_winAbout.MdiParent = this; m_winLicense.MdiParent = this; m_winCritical.MdiParent = this; m_winExpiry.MdiParent = this; m_winAccounts.MdiParent = this; m_winExpenseReport = new frmExpenseReport(m_user); m_winExpenseReport.MdiParent = this; m_winAccountsReceivable = new frmAccountsReceivable(m_user); m_winAccountsReceivable.MdiParent = this; m_winCategory.MdiParent = this; m_reloadHistory.MdiParent = this; m_ecashTransactions.MdiParent = this; m_smartcashtrans.MdiParent = this; m_eloadtrans.MdiParent = this; m_loadwallettrans.MdiParent = this; }
//private bool GetApproval(UserAccess accesslevel = UserAccess.Cashier) //{ // if (m_user.LoginType <= (int)accesslevel) // { // return true; // } // else // { // if (accesslevel == UserAccess.Admin) // MessageBox.Show("This action requires approval from Administrator.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // else if (accesslevel == UserAccess.Manager) // MessageBox.Show("This action requires approval from Manager.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // else if (accesslevel == UserAccess.Supervisor) // MessageBox.Show("This action requires approval from Manager/Supervisor.", "Approval", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // frmApproval login = new frmApproval((int)accesslevel); // if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK) // { // clsUsers iuser = login.m_User; // if (iuser.LoginType <= (int)accesslevel) return true; // } // } // return false; //} private void frmUtility_Load(object sender, EventArgs e) { clsThemes.ApplyTheme(this, new clsThemes.ThemeSettings(Properties.Settings.Default.Theme)); if (m_user == null || m_POS == null) { frmLogin login = new frmLogin(); if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK) { m_user = login.m_User; m_winSetup = new frmSetup(m_user); if (clsUtil.GetApproval(m_user, UserAccess.Manager)) { ShowSplashScreen(); } else { Application.Exit(); } } else { Application.Exit(); } } }