Beispiel #1
0
 public MainForm()
 {
     InitializeComponent();
     _crudStudent = new CRUDStudent();
     OpenFileFromDirectory();
     SetAutoSortModeIsTrue();
 }
Beispiel #2
0
        private void AddRowAdressButton_Click(object sender, EventArgs e)
        {
            _crudStudent = new CRUDStudent(student);
            using (var newAdressForm = new AdressForm(adressDataTable, _crudStudent, currentRowIndex, FlagAddOrUpdate.Addition))
            {
                newAdressForm.ShowDialog();
            }

            SetButtonsAdressEnabledOrDisabled();
        }
Beispiel #3
0
        private void AddRowContactButton_Click(object sender, EventArgs e)
        {
            _crudStudent = new CRUDStudent(student);
            using (var newAddFormContacts = new AddFormContacts(contactDataTable, _crudStudent, currentRowIndex, FlagAddOrUpdate.Addition))
            {
                newAddFormContacts.ShowDialog();
            }

            SetButtonsContactEnabledOrDisabled();
        }
Beispiel #4
0
 public AddFormStudent(MainForm mainForm) : this()
 {
     this.mainForm    = mainForm;
     student          = new Student();
     _crudStudent     = new CRUDStudent();
     contactDataTable = CreateDataTableContacts();
     adressDataTable  = CreateDataTableAdress();
     AddBindingDataSourceDataTableContact();
     AddBindingSourceDataTableAdress();
     AddButton.Enabled = false;
     SetOptionsForUpdateOrAdditingForm(flag);
 }
Beispiel #5
0
        public AddFormContacts(DataTable dataTableContact, CRUDStudent crudStudent, int currentRowContactIndex, FlagAddOrUpdate flag) : this()
        {
            SetDataSourceTypeContactComboBox();

            _currentRowContactIndex = currentRowContactIndex;
            _dataTableContact       = dataTableContact;
            _crudStudent            = crudStudent;
            _flag = flag;

            SetAdditingOrUpdateForm(flag);
            SetOptionColorForStringMaskedTextBox();
        }
Beispiel #6
0
        public AdressForm(DataTable dataTableAdress, CRUDStudent crudStudent, int currentRowAdressIndex, FlagAddOrUpdate flag) : this()
        {
            SetDataSourceTypeAdressComboBox();

            _dataTableAdress       = dataTableAdress;
            _crudStudent           = crudStudent;
            _currentRowAdressIndex = currentRowAdressIndex;
            _flag = flag;

            OkButton.Enabled = false;

            SetSetAdditingOrUpdateForm(flag);
        }
Beispiel #7
0
        private void InitializeFieldsAndDataGridsAddFormStudent()
        {
            FirstNameTextBox.Text      = student.firstName;
            PatronymicNameTextBox.Text = student.patronimycName;
            LastNameTextBox.Text       = student.lastName;

            CourseComboBox.Text    = student.curriculumList.course;
            GroupTextBox.Text      = student.curriculumList.group;
            FacultyTextBox.Text    = student.curriculumList.faculty;
            SpecialityTextBox.Text = student.curriculumList.speciality;

            RefreshDataTableContacts(student, contactDataTable);
            RefreshDataTableAdress(student, adressDataTable);
            _crudStudent = new CRUDStudent(student);
        }