示例#1
0
        private void savePreiousStudentButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (dakhlaNumbersList.SelectedItems.Count == 1)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Student student = sameRegistrationNumberStudentsList[Convert.ToInt32(dakhlaNumbersList.SelectedItem)];
                    student.StudentDakhlaNumber.DakhlaNumber = Convert.ToInt32(newDakhlaNumberLabel.Text);
                    student.StudentDakhlaNumber.FormNumber   = Convert.ToInt32(newFormNumberLabel.Text);
                    student.StudentDakhlaNumber.ActiveIndex  = true;
                    DataManipulation.addStudent(student, true);

                    DakhlaCardReport rpt = new DakhlaCardReport();
                    rpt.Student = student;

                    LandingPage newPage = new LandingPage();
                    this.Hide();
                    newPage.Show();
                    rpt.Show();
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    MessageBox.Show("داخلہ نمبر سلیکت کیجئے۔");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
        //      Save Student Tab

        private void saveButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(nameStudentTextbox.Text) || String.IsNullOrEmpty(fatherNameStudentTextbox.Text) ||
                String.IsNullOrEmpty(requiredDarjaStudentCombobox.Text) || String.IsNullOrEmpty(takmeelDateCombobox.Text) ||
                String.IsNullOrEmpty(takmeelMonthCombobox.Text) || String.IsNullOrEmpty(takmeelYearCombobox.Text))
            {
                if (String.IsNullOrEmpty(nameStudentTextbox.Text))
                {
                    errorProvider.SetError(nameStudentTextbox, "طالبعلم کا نام ضروری ہے۔");
                }

                if (String.IsNullOrEmpty(fatherNameStudentTextbox.Text))
                {
                    errorProvider.SetError(fatherNameStudentTextbox, "والد کا نام ضروری ہے۔");
                }

                if (String.IsNullOrEmpty(requiredDarjaStudentCombobox.Text))
                {
                    errorProvider.SetError(requiredDarjaStudentCombobox, "درجہ ضروری ہے۔");
                }

                if (String.IsNullOrEmpty(takmeelDateCombobox.Text) || String.IsNullOrEmpty(takmeelMonthCombobox.Text) ||
                    String.IsNullOrEmpty(takmeelYearCombobox.Text))
                {
                    errorProvider.SetError(takmeelDateCombobox, "تاریخ تکمیل ضروری ہے۔");
                }
            }
            else
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Student newStudent = getStudentFromForm();
                    DataManipulation.addStudent(newStudent, false);

                    DakhlaCardReport rpt = new DakhlaCardReport();
                    rpt.Student = newStudent;

                    LandingPage newPage = new LandingPage();
                    this.Hide();
                    newPage.Show();
                    rpt.Show();
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    Cursor.Current = Cursors.Default;
                }
            }
        }
示例#3
0
 private void printCardButton_Click(object sender, EventArgs e)
 {
     if (studentGridView.SelectedRows.Count == 1)
     {
         Cursor.Current = Cursors.WaitCursor;
         int dakhlaNumber = Convert.ToInt32(studentGridView.SelectedRows[0].Cells[1].Value);
         foreach (var item in activeStudentList)
         {
             if (item.StudentDakhlaNumber.DakhlaNumber == dakhlaNumber)
             {
                 DakhlaCardReport rpt = new DakhlaCardReport();
                 rpt.Student = item;
                 rpt.Show();
                 break;
             }
         }
         Cursor.Current = Cursors.Default;
     }
 }