Ejemplo n.º 1
0
        //Add or remove formulas in a new dialogue box
        private void formulaOptions_Click(object sender, EventArgs e)
        {
            currentSubject = (Subject)listSubject.SelectedValue;
            currentTopic = (Topic)listTopic.SelectedValue;

            if (currentSubject != null && currentTopic != null)
            {
                ListEdit ld = new ListEdit(subjects, currentSubject, currentTopic, ListEdit.listType.Formula);
                ld.ShowDialog();

                if(ld.DialogResult == DialogResult.OK)
                {
                    listFormula.DataSource = null;
                    listFormula.DataSource = currentTopic.formulas;
                }
            }
            else
            {
                statusSay.Text = "Invalid Subject or Topic";
            }
        }
Ejemplo n.º 2
0
        //Add or remove topics in a new dialogue box
        private void topicOptions_Click(object sender, EventArgs e)
        {
            currentSubject = (Subject)listSubject.SelectedValue;

            if (currentSubject != null)
            {
                ListEdit ld = new ListEdit(subjects, currentSubject, ListEdit.listType.Topic);
                ld.ShowDialog();

                if(ld.DialogResult == DialogResult.OK)
                {
                    listTopic.DataSource = null;
                    listTopic.DataSource = currentSubject.topics;

                    if(currentTopic == null && currentSubject.topics.Count > 0)
                    {
                        currentTopic = currentSubject.topics[0];
                    }
                }

            }
            else
            {
                statusSay.Text = "Invalid Subject.";
            }
        }
Ejemplo n.º 3
0
        //Add or remove subjects in a new dialogue box
        private void subjectOptions_Click(object sender, EventArgs e)
        {
            ListEdit ld = new ListEdit(subjects, ListEdit.listType.Subject);
            ld.ShowDialog();

            if(ld.DialogResult == DialogResult.OK)
            {
                listSubject.DataSource = null;
                listSubject.DataSource = subjects;
            }
        }