private void mainTab_SelectedIndexChanged(object sender, EventArgs e) { if (mainTab.SelectedTab == mainTab.TabPages["addNewStudentTab"]) { Cursor.Current = Cursors.WaitCursor; fillZilaComboBox(); fillTehseelComboBox(); fillDakKhanaComboBox(); fillVillageComboBox(); fillAreaComboBox(); fillSectorComboBox(); DataManipulation.getNewRegistration_FormAndDakhlaNumber(); formNumberLabel.Text = StudentRegAndDakhlaNumber.FormNumber.ToString(); registrationNumberLabel.Text = StudentRegAndDakhlaNumber.RegistrationNumber.ToString(); dakhlaNumberLabel.Text = StudentRegAndDakhlaNumber.DakhlaNumber.ToString(); Cursor.Current = Cursors.Default; } else if (mainTab.SelectedTab == mainTab.TabPages["addPreviousStudentTab"]) { Cursor.Current = Cursors.WaitCursor; DataManipulation.getNewDakhlaNumber(); DataManipulation.getNewFormNumber(); newFormNumberLabel.Text = StudentRegAndDakhlaNumber.FormNumber.ToString(); newDakhlaNumberLabel.Text = StudentRegAndDakhlaNumber.DakhlaNumber.ToString(); Cursor.Current = Cursors.Default; } }
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()); } }
public LandingPage() { Cursor.Current = Cursors.WaitCursor; InitializeComponent(); activeStudentList = DataManipulation.getAllStudents(true).ToArray(); inActiveStudentList = DataManipulation.getAllStudents(false).ToArray(); fileName = null; editStudentButton.Enabled = false; deleteStudentButton.Enabled = false; printCardButton.Enabled = false; exportGridView.Enabled = false; Cursor.Current = Cursors.Default; }
// 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; } } }
private void updateButton_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 { Student newStudent = getStudentFromForm(); DataManipulation.editStudent(newStudent); LandingPage newPage = new LandingPage(); newPage.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
private void deleteStudentButton_Click(object sender, EventArgs e) { List <string> dakhlaNumbers = new List <string>(); foreach (DataGridViewRow row in studentGridView.SelectedRows) { dakhlaNumbers.Add(row.Cells[1].Value.ToString()); } DialogResult confirm = MessageBox.Show("Are you sure, You want to delete students?", "Delete Student", MessageBoxButtons.YesNo); if (confirm == DialogResult.Yes) { DataManipulation.deleteStudent(dakhlaNumbers); LandingPage newPage = new LandingPage(); this.Hide(); newPage.Show(); newPage.mainTab.SelectedIndex = 2; //searchStudentButton.PerformClick(); } }
private void searchDakhlaNumbers_Click(object sender, EventArgs e) { dakhlaNumbersList.Items.Clear(); clearLabels(); sameRegistrationNumberStudentsList.Clear(); try { List <String> dakhlaNumbers = DataManipulation.getDakhlaNumbers(regNumTextbox.Text); if (dakhlaNumbers.Any()) { foreach (var item in dakhlaNumbers) { dakhlaNumbersList.Items.Add(item); } foreach (String item in dakhlaNumbers) { foreach (Student student in inActiveStudentList) { if (Convert.ToInt32(item) == student.StudentDakhlaNumber.DakhlaNumber) { sameRegistrationNumberStudentsList.Add(student.StudentDakhlaNumber.DakhlaNumber, student); } } } StudentRegAndDakhlaNumber.RegistrationNumber = Convert.ToInt32(regNumTextbox.Text); newRegistratioNumberLabel.Text = StudentRegAndDakhlaNumber.RegistrationNumber.ToString(); } else { MessageBox.Show("سابق طالبعلم نہیں ہے۔"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button4_Click(object sender, EventArgs e) { DataManipulation.backUpDatabase(); }