Ejemplo n.º 1
0
        /// <summary>
        /// Конструктор объекта формы администратора
        /// </summary>
        /// <param name="control">Объект управления действиями</param>
        public AdminForm(ControlActions control, ApplicationContextUT context)
        {
            InitializeComponent();
            Context = context;
            Context.AddForm();
            Control                          = new ControlActionsAdmin(control, this);
            ListQuestions                    = null;
            EventButtonsUsers                = false;
            EventButtonsQuestions            = false;
            cmbLevelDifficulty.SelectedIndex = 0;
            cmbSubject.SelectedIndex         = 0;


            this.FormClosed += (sender, e) => Context.RemoveForm();

            btnAddQuestion.Click               += AddQuestion;
            rbAddQuestion.CheckedChanged       += RbAddQuestion_CheckedChanged;
            rbEditQuestion.CheckedChanged      += RbEditQuestion_CheckedChanged;
            rbQuestionByNumber.CheckedChanged  += RbQuestionByNumber_CheckedChanged;
            rbQuestionsByFilter.CheckedChanged += RbQuestionsByFilter_CheckedChanged;
            btnOutputQuestions.Click           += (sender, e) => OutputQuestions();
            nudListNumberQuestion.ValueChanged += (sender, e) => OutputListQuestion();
            btnEditQuestion.Click              += EditQuestion;

            rbLogin.CheckedChanged += (sender, e) => ChangeEnabledTBLogin();
            btnOutputUsers.Click   += (sender, e) => OutputUsers();
            btnChangeRole.Click    += ChangeRole;
            btnChangeActing.Click  += ChangeActing;

            btnUserMode.Click += SwitchingUserMode;
        }
        /// <summary>
        /// Конструктор объекта формы аутенфикации пользователя
        /// </summary>
        public UserAuthenticationForm(ApplicationContextUT context)
        {
            InitializeComponent();
            Context = context;
            Context.AddForm();
            Control      = new ControlActionsAuthenticationUser(this);
            EventButtons = false;

            this.FormClosed       += (sender, e) => Context.RemoveForm();
            btnRegistration.Click += BtnRegistration_Click;
            btnEntrance.Click     += BtnEntrance_Click;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Конструктор объекта формы пользователя
        /// </summary>
        public UserForm(ControlActions control, ApplicationContextUT context)
        {
            InitializeComponent();
            Context = context;
            Context.AddForm();
            Control                  = new ControlActionsUser(control, this);
            EventButtons             = false;
            cmbSubject.SelectedIndex = 0;

            this.FormClosed += (sender, e) => Context.RemoveForm();

            btnOutputTest.Click   += OutputTest;
            btnTestComplete.Click += TestComplete;
            btnAdminMode.Click    += SwitchingAdminMode;
            nudListNumberQuestion.ValueChanged += (sender, e) => OutputListAnswer();
            rbtAnswer1.CheckedChanged          += CheckedChangedAnswer;
            rbtAnswer2.CheckedChanged          += CheckedChangedAnswer;
            rbtAnswer3.CheckedChanged          += CheckedChangedAnswer;
            rbtAnswer4.CheckedChanged          += CheckedChangedAnswer;
        }