Ejemplo n.º 1
0
        private void MainMenu_Load(object sender, EventArgs e)
        {
            loginform = Application.OpenForms["LogIn"];
            session   = LogInControl.GetEmployee(((LogIn)loginform).GetUsername(), ((LogIn)loginform).GetPassword());
            if (session.Authority == Authority.Personel)
            {
                groupBox2.Visible = false;
            }
            else if (session.Authority == Authority.Manager)
            {
                groupBox2.Visible = true;
            }

            cmbCategories.DataSource    = crepo.Get();
            cmbCategories.DisplayMember = "CategoryName";
        }
Ejemplo n.º 2
0
        internal void Navigate(ModesEnum mode)
        {
            switch (mode)
            {
            case ModesEnum.LogIn:
                _contentWindow.ContentControl.Content = _loginControl ?? (_loginControl = new LogInControl());
                break;

            case ModesEnum.TextEditor:
                _contentWindow.ContentControl.Content = _textEditorControl ?? (_textEditorControl = new TextEditorControl());
                break;

            case ModesEnum.SignUp:
                _contentWindow.ContentControl.Content = _signUpControl ?? (_signUpControl = new SignUpControl());
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
            }
        }