private void cboQuestionTypeSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            int questionType = cboQuestionTypeSelector.SelectedIndex + 1;

            lbvRowOptions.DataSource    = null;
            lbvColumnOptions.DataSource = null;

            switch (questionType)
            {
            case 5:
                lbvRowOptions.DataSource    = _rRepository.GetByType(2);
                lbvColumnOptions.DataSource = _rRepository.GetByType(1);
                break;

            case 6:
            case 7:
                lbvRowOptions.DataSource = _rRepository.GetByType(2);
                break;

            case 8:
                lbvRowOptions.DataSource = _rRepository.GetByType(1);
                break;

            case 9:
                lbvRowOptions.DataSource = _rRepository.GetByType(3);
                break;
            }
        }
Пример #2
0
        private void cboItemTypeSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            int type = cboItemTypeSelector.SelectedIndex;

            btnAdd.Enabled = false;

            if (currentLayout != null)
            {
                FormHelper.ClearFields(currentLayout);
                FormHelper.ClearErrors(currentLayout, errorProvider);
                currentLayout.Visible = false;
                currentLayout         = null;
            }

            switch (type)
            {
            case 0:
            case 1:
            case 2:
                dgvItems.DataSource      = rRepository.GetByType(type + 1);
                pnResourceLayout.Visible = true;
                currentLayout            = pnResourceLayout;
                break;

            case 3:
                dgvItems.DataSource            = uRepository.GetAll();
                cboUserResearchArea.DataSource = raRepository.GetAll();
                pnUserLayout.Visible           = true;
                currentLayout  = pnUserLayout;
                btnAdd.Enabled = true;
                break;

            case 4:
                dgvItems.DataSource      = wsRepository.GetAll();
                pnResourceLayout.Visible = true;
                currentLayout            = pnResourceLayout;
                break;

            case 5:
                dgvItems.DataSource = faRepository.GetAll();
                cboFishingAreaResearchArea.DataSource = raRepository.GetAll();
                pnFishingAreaLayout.Visible           = true;
                currentLayout = pnFishingAreaLayout;
                break;

            case 6:
                dgvItems.DataSource = raRepository.GetAll();
                cboResearchAreaWaterSystem.DataSource = wsRepository.GetAll();
                pnResearchAreaLayout.Visible          = true;
                currentLayout = pnResearchAreaLayout;
                break;
            }
        }