Пример #1
0
        private void addNewStudentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!_mdiForm.Jarvis.CurrentUser.UserHasPermissionForAction("Student", "Add"))
            {
                return;
            }

            StudentAddEdit frm = new StudentAddEdit(new Student(), this);

            frm.headerLabel.Text = "Student Add";
            frm.Text             = "Add New Student";
            //frm.MdiParent = this;
            //frm.Dock = DockStyle.Fill;
            //frm.FormBorderStyle = FormBorderStyle.None;
            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                //if (Application.OpenForms["StudentSearch"] as StudentSearch != null)
                //{
                //StudentSearch frm1 = (StudentSearch)Application.OpenForms["StudentSearch"];
                LoadStudentList();
                SetDataSource();
                //}
                //{
            }
        }
Пример #2
0
        private void EthnicityEdit_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_changes.Count > 0)
            {
                EthnicityData ed = new EthnicityData();
                ed.Update(_changes);

                if (Application.OpenForms["StudentAddEdit"] as StudentAddEdit != null)
                {
                    StudentAddEdit frm1 = (StudentAddEdit)Application.OpenForms["StudentAddEdit"];
                    frm1.PopulateEthnicityComboBox();
                }
            }
        }
Пример #3
0
        private void ethnicityToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Jarvis.CurrentUser.UserHasPermissionForAction("Admin", "View"))
            {
                return;
            }
            EthnicityEdit ab = new EthnicityEdit();

            ab.ShowDialog();
            if (ab.DialogResult == DialogResult.OK)
            {
                if (Application.OpenForms["StudentAddEdit"] as StudentAddEdit != null)
                {
                    StudentAddEdit frm1 = (StudentAddEdit)Application.OpenForms["StudentAddEdit"];
                    frm1.PopulateEthnicityComboBox();
                }
            }
        }
Пример #4
0
        private void dataGridView1_RowHeaderMouseDoubleClick_1(object sender, DataGridViewCellMouseEventArgs e)
        {
            //if (!_mdiForm.Jarvis.CurrentUser.UserHasPermissionForAction("Student", "Edit"))
            //    return;

            int    index    = e.RowIndex;
            int    personId = (int)dataGridView1.Rows[e.RowIndex].Cells[0].Value;
            Person person   = _allStudentList.Find(x => x.PersonId == personId);

            if (person != null)
            {
                if (Application.OpenForms["StudentAddEdit"] as StudentAddEdit != null)
                {
                    StudentAddEdit frm1 = (StudentAddEdit)Application.OpenForms["StudentAddEdit"];
                    frm1.Close();
                }
                StudentAddEdit frm = new StudentAddEdit(person, this);
                frm.MdiParent       = _mdiForm;
                frm.Dock            = DockStyle.Fill;
                frm.FormBorderStyle = FormBorderStyle.None;
                frm.Show();
            }
        }
 public StudentEditIntialiser(Form input) : base(input)
 {
     se = (StudentAddEdit)_form;
     PaintButtonBackColor();
 }