private void MainForm_Load(object sender, EventArgs e)
        {
            int width  = Screen.PrimaryScreen.Bounds.Width;
            int height = Screen.PrimaryScreen.Bounds.Height;

            this.Location = new Point(0, 0);
            this.Size     = new Size(width, height);
            FormsUI.SetBackGroundColorOfMDIForm(Color.FromArgb(40, 40, 40), this.Controls);

            GetCurrentUserInfo();
        }
        private void Manager_btn_Click(object sender, EventArgs e)
        {
            this.managerMainForm = new Manager();
            string invalidAuthorizationMessage;
            bool   isUserAuthorized = this.managerMainForm.CheckForPermission(userRoles, out invalidAuthorizationMessage);

            if (isUserAuthorized)
            {
                FormsUI.LoadChildForm(this, this.managerMainForm, ChildNastedLevel.Nasted, this.Manager_btn);
            }
            else
            {
                SampleMessageBox.Show(invalidAuthorizationMessage);
            }
        }
        private static void DisplayRecords(DataGridNavigation navigationName, string connectionStr, string cmdStr, Display firstOrLastPage)
        {
            navigationName.ConnectionString = connectionStr;
            navigationName.CommandString    = cmdStr;
            DataGridView dataGridName = navigationName.DataGridName;

            //navigationName.PageSize = 15;
            if (firstOrLastPage == Display.FirstPage)
            {
                navigationName.FillDataGridWithRecords(firstOrLastPage);
            }
            if (firstOrLastPage == Display.LastPage)
            {
                navigationName.FillDataGridWithRecords(firstOrLastPage);
            }
            FormsUI.DisableSorting(dataGridName);
        }
 private void rolesCenter_btn_Click(object sender, EventArgs e)
 {
     this.rolesCenterForm = new RolesCenter();
     FormsUI.LoadChildForm(this, this.rolesCenterForm, ChildNastedLevel.NastedNasted, this.rolesCenter_btn);
 }
 private void usersAccountsCenter_btn_Click(object sender, EventArgs e)
 {
     this.usersCenterForm = new UsersAccountsCenter();
     FormsUI.LoadChildForm(this, this.usersCenterForm, ChildNastedLevel.NastedNasted, this.usersAccountsCenter_btn);
 }
Esempio n. 6
0
 private void editVendors_btn_Click(object sender, EventArgs e)
 {
     this.editDeleteVendorsForm = new EditDeleteVendors();
     FormsUI.LoadChildForm(this, this.editDeleteVendorsForm, ChildNastedLevel.NastedNastedNasted, this.editVendors_btn);
 }
Esempio n. 7
0
 private void addVendors_btn_Click(object sender, EventArgs e)
 {
     this.addVendorsForm = new AddVendors();
     FormsUI.LoadChildForm(this, this.addVendorsForm, ChildNastedLevel.NastedNastedNasted, this.addVendors_btn);
 }
 private void InventoryCenter_btn_Click(object sender, EventArgs e)
 {
     this.inventoryCenterForm = new InventoryCenter();
     FormsUI.LoadChildForm(this, this.inventoryCenterForm, ChildNastedLevel.NastedNasted, this.InventoryCenter_btn);
 }
 private void InStock_btn_Click(object sender, EventArgs e)
 {
     this.stockForm = new Stock();
     FormsUI.LoadChildForm(this, this.stockForm, ChildNastedLevel.NastedNastedNasted, this.InStock_btn);
 }