コード例 #1
0
        /// <summary>
        /// Button Select Admission. Load Form_SelectAdmission.
        /// </summary>
        /// <param name="sender">Object sender.</param>
        /// <param name="e">Contains event arguments.</param>
        private void ButtonSelectRegistrationId_Click(object sender, EventArgs e)
        {
            int     admissionId;
            string  name;
            string  surname;
            string  year;
            string  semesterName;
            decimal fee;

            using (Form_SelectAdmission selectAdmission = new Form_SelectAdmission())
            {
                selectAdmission.ShowDialog();

                if (selectAdmission.SelectedIndex > 0)
                {
                    admissionId     = int.Parse(selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["AdmissionId"].Value.ToString());
                    name            = selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["Name"].Value.ToString();
                    surname         = selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["Surname"].Value.ToString();
                    year            = selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["Year"].Value.ToString();
                    this.semesterId = int.Parse(selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["SemesterId"].Value.ToString());
                    semesterName    = selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["SemesterName"].Value.ToString();
                    fee             = decimal.Parse(selectAdmission.DataGridViewAdmissions.CurrentRow.Cells["CourseFee"].Value.ToString());

                    this.labelRegistrationId.Text = admissionId.ToString();
                    this.labelName.Text           = name;
                    this.labelSurname.Text        = surname;
                    this.labelDate.Text           = year;
                    this.labelSemester.Text       = semesterName;
                    this.labelFee.Text            = Math.Round(fee, 2).ToString();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Select student. Load Form_SelectAdmission.
        /// </summary>
        /// <param name="sender">Object sender.</param>
        /// <param name="e">Contains event arguments.</param>
        private void ButtonSelectRegistrationId_Click(object sender, EventArgs e)
        {
            int admissionId;

            using (Form_SelectAdmission selectAdmission = new Form_SelectAdmission())
            {
                selectAdmission.ShowDialog();
                admissionId = selectAdmission.SelectedIndex;
            }

            if (admissionId > 0)
            {
                this.PopulateTheStudentData(admissionId);
            }
        }
コード例 #3
0
        /// <summary>
        /// Button search student by admission id.
        /// </summary>
        /// <param name="sender">Object sender.</param>
        /// <param name="e">Contains event argument.</param>
        private void ButtonSelectStudent_Click(object sender, EventArgs e)
        {
            int admissionId;

            using (Form_SelectAdmission selectAdmission = new Form_SelectAdmission())
            {
                selectAdmission.ShowDialog();
                ////admissionId = int.Parse(selectAdmission.dataGridView_Admissions.CurrentRow.Cells["AdmissionId"].Value.ToString());
                admissionId = selectAdmission.SelectedIndex;
            }

            if (admissionId > 0)
            {
                this.PopulateStudentDetails(admissionId);
            }
        }