예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int       cmbPos = txtartcourse.SelectedIndex;
            addcourse ac     = new addcourse();

            ac.ShowDialog();

            Courses   co     = new Courses();
            DataTable dtname = new DataTable();

            dtname = co.Search("SELECT coursename FROM courses");
            txtartcourse.DataSource    = dtname;
            txtartcourse.DisplayMember = "coursename";
            txtartcourse.ValueMember   = "coursename";

            txtartcourse.SelectedIndex = cmbPos;
        }
예제 #2
0
        private void پورتالاطلاعاتدورههایهنریToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool IsOpen = false;

            foreach (Form f in Application.OpenForms)
            {
                if (f.GetType() == typeof(addcourse))
                {
                    IsOpen = true;
                    f.Focus();
                    break;
                }
            }

            if (IsOpen == false)
            {
                addcourse fmi = new addcourse();
                fmi.MdiParent = this;
                fmi.Show();
            }
        }