Пример #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            frmSetCourses sc = new frmSetCourses();

            sc.Show();
            sc.lbl_control_id.Text = curriculumData.c_id;
            sc.lbl_title.Text      = lbl_title.Text;
            this.Hide();
        }
Пример #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (btnSave.Text == "SAVE")
            {
                string       dt = dtpDatePublished.Value.ToString("dddd, dd MMMM yyyy");
                DialogResult dr = MessageBox.Show("Do you want to save?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dr == DialogResult.Yes)
                {
                    frmSetCourses sc = new frmSetCourses();
                    curriculumData.c_id = md.CreateCurriculum(txtCurriculumTitle.Text, txtPublishedBy.Text, dt);
                    sc.Show();
                    sc.lbl_title.Text = "Curriculum Title: " + txtCurriculumTitle.Text;
                    //sc.lbl_control_id.Text = md.CreateCurriculum(txtCurriculumTitle.Text, txtPublishedBy.Text, dt);
                    sc.lbl_control_id.Text = curriculumData.c_id;

                    this.Hide();
                }
            }
            else
            {
                string       dt = dtpDatePublished.Value.ToString("dddd, dd MMMM yyyy");
                DialogResult dr = MessageBox.Show("Do you want to save the edit?", "Edit", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dr == DialogResult.Yes)
                {
                    frmSetCourses sc = new frmSetCourses();
                    sc.Show();
                    sc.lbl_title.Text = "Curriculum Title: " + txtCurriculumTitle.Text;
                    //sc.lbl_control_id.Text = md.CreateCurriculum(txtCurriculumTitle.Text, txtPublishedBy.Text, dt);
                    string active = "inactive";
                    string used   = "NO";
                    if (rdoActive.Checked == true)
                    {
                        active = "active";
                    }
                    if (rdoUsed.Checked == true)
                    {
                        used = "YES";
                    }
                    md.C_editCurriculum(used, txtCurriculumTitle.Text, txtPublishedBy.Text, dt, active);
                    this.Hide();
                }
            }
        }