private void AddAlternativeForm_Load(object sender, EventArgs e)
        {
            foreach (var form in this.Owner.MdiChildren)
            {
                if (form.GetType() == typeof(AlternativeListForm))
                {
                    alternativeListForm = (AlternativeListForm)form;
                }
            }

            mainForm                  = (MainForm)this.Owner;
            criteriaController        = new CriteriaController();
            alternativeListController = new AlternativeListController();
            currentTopicId            = alternativeListForm.getCurrentTopicId();
            currentUserName           = alternativeListForm.getCurrentUserName();

            if (action == "Edit")
            {
                this.Text = "Edit Alternative: " + selectedAlternativeName;
                txtAlternativeName.Text = selectedAlternativeName;
                btnAdd.Visible          = false;
                btnEdit.Visible         = true;
            }
            else if (action == "Add")
            {
                this.Text = "Add Alternative";
                txtAlternativeName.Text = "";
                btnAdd.Visible          = true;
                btnEdit.Visible         = false;
            }

            flowLayoutPanel1.Controls.Clear();
            foreach (Criteria criteria in criteriaController.getCriteriaList(currentTopicId))
            {
                int    criteriaId   = criteria.criteriaId;
                string criteriaName = criteria.criteriaName;
                string criteriaUnit = criteria.criteriaUnit;
                bool   isBoolean    = criteria.isBoolean;
                double value        = 0;

                if (action == "Edit")
                {
                    value = alternativeListController.valueLookup(criteriaId, selectedAlternativeName);
                }

                AddAlternativeUserControl addAlternativeUserControl = new AddAlternativeUserControl(criteriaId, criteriaName, criteriaUnit, isBoolean, value);
                addAlternativeUserControl.Parent = flowLayoutPanel1;
                flowLayoutPanel1.Controls.Add(addAlternativeUserControl);
            }
        }
Esempio n. 2
0
        private void AlternativeListForm_Load(object sender, EventArgs e)
        {
            mainForm = (MainForm)this.MdiParent;
            alternativeListController = new AlternativeListController();
            criteriaController        = new CriteriaController();
            currentTopicId            = mainForm.getCurrentTopic().topicId.ToString();
            currentUserName           = mainForm.getCurrentUser().userName;
            isFormEdited = false;

            refreshTable();

            if (alternativeListController.getAlternativeList(currentTopicId).Count < 1)
            {
                MessageBox.Show(this, "Please input 2-11 alternatives", "Alternative List", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void CriteriaForm_Load(object sender, EventArgs e)
        {
            mainForm                  = (MainForm)this.MdiParent;
            criteriaController        = new CriteriaController();
            alternativeListController = new AlternativeListController();
            currentTopicId            = mainForm.getCurrentTopic().topicId.ToString();
            currentUserName           = mainForm.getCurrentUser().userName;
            isIsBooleanChanged        = false;

            refreshForm();

            if (dataGridView1.RowCount < 3)
            {
                MessageBox.Show(this, "Please input 3-6 criterias", "Criteria List", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 4
0
        private void ResultForm_Load(object sender, EventArgs e)
        {
            mainForm                  = (MainForm)this.MdiParent;
            criteriaController        = new CriteriaController();
            alternativeListController = new AlternativeListController();
            resultController          = new ResultController();
            currentTopicId            = mainForm.getCurrentTopic().topicId.ToString();

            this.Text = "Result for " + mainForm.getCurrentTopic().topicName;

            if (alternativeListController.getAlternativeList(currentTopicId).Count < 2)
            {
                this.Close();
            }
            else
            {
                loadDynamicUI();
            }
        }
Esempio n. 5
0
        private void CriteriaRankingForm_Load(object sender, EventArgs e)
        {
            mainForm = (MainForm)this.MdiParent;
            criteriaWeightController = new CriteriaWeightController();
            try
            {
                currentTopicId = mainForm.getCurrentTopic().topicId.ToString();
            }
            catch
            {
                this.Close();
            }


            criteriaController = new CriteriaController();
            criteriaController.autoInsertCriteriaWeight(currentTopicId);

            loadDynamicUI();

            triggerUpdateLabelConsistencyInfo();
        }