private void SetFieldsUpdateFormContact() { var gettingContact = _crudStudent.GetContact(_currentRowContactIndex); TypeContactComboBox.Text = DictionaryForRefreshDataTables.GetContactTypeEnumToString(gettingContact.contactType); stringMaskedTextBox.Text = gettingContact.contactValue; }
private void RefreshDataTableContacts(Student student, DataTable dataContacts) { dataContacts.Rows.Clear(); foreach (var element in student.contactsList) { dataContacts.Rows.Add(DictionaryForRefreshDataTables.GetContactTypeEnumToString(element.contactType), element.contactValue); } }
private void SetFieldsUpdateFormAdress() { var gettingAdress = _crudStudent.GetAdress(_currentRowAdressIndex); TypeAdressComboBox.Text = DictionaryForRefreshDataTables.GetAdressTypeEnumToString(gettingAdress.adressType); StreetTextBox.Text = gettingAdress.street; CityTextBox.Text = gettingAdress.city; PostIndexMaskedTextBox.Text = gettingAdress.postindex; }
private void RefreshDataTableAdress(Student student, DataTable dataTableAdress) { dataTableAdress.Rows.Clear(); foreach (var element in student.addressList) { dataTableAdress.Rows.Add(DictionaryForRefreshDataTables.GetAdressTypeEnumToString(element.adressType), element.city, element.postindex, element.street); } }
private void AddRowsDataTableContact(List <Contact> contact, DataTable dataTable) { dataTable.Rows.Clear(); foreach (var element in contact) { dataTable.Rows.Add(DictionaryForRefreshDataTables.GetContactTypeEnumToString(element.contactType), element.contactValue); } }
private void AddRowsDataTableAdress(List <Adress> adressList, DataTable dataTable) { dataTable.Rows.Clear(); foreach (var element in adressList) { dataTable.Rows.Add(DictionaryForRefreshDataTables.GetAdressTypeEnumToString(element.adressType), element.city, element.postindex, element.street); } }
/// <summary> /// Вспомогательные функции для работы с формой /// </summary> #region SuportingFunctions private void CreateAndAddRowContact() { var contactType = DictionaryForRefreshDataTables.GetContactTypeByValueContactTypeCombobox(_contactType); var newContact = new Contact { contactType = contactType, contactValue = _stringContact }; _crudStudent.CreateNewContact(newContact); AddRowsDataTableContact(_crudStudent.GetContactList(), _dataTableContact); }
private void CreateAndAddRowAdress() { AdressType adressType = DictionaryForRefreshDataTables.GetAdressTypeByValueAdressTypeComboBox(_typeAdress); Adress newAdress = new Adress() { adressType = adressType, city = _cityProperty, postindex = _porsIndexProperty, street = _streetProperty }; _crudStudent.CreateNewAdress(newAdress); AddRowsDataTableAdress(_crudStudent.GetAdressList(), _dataTableAdress); }
private void UpdateFromDataTableContact() { var contactType = DictionaryForRefreshDataTables.GetContactTypeByValueContactTypeCombobox(TypeContactComboBox.Text); var contact = stringMaskedTextBox.Text; var newContact = new Contact() { contactType = contactType, contactValue = contact }; var thisDeleteContact = _crudStudent.GetContact(_currentRowContactIndex); _crudStudent.DeleteCurrentContact(thisDeleteContact); _crudStudent.UpdateCurrentContact(thisDeleteContact, newContact, _currentRowContactIndex); AddRowsDataTableContact(_crudStudent.GetContactList(), _dataTableContact); }
private void UpdateFromDataTableAdress() { var adressType = DictionaryForRefreshDataTables.GetAdressTypeByValueAdressTypeComboBox(TypeAdressComboBox.Text); var city = CityTextBox.Text; var street = StreetTextBox.Text; var postIndex = PostIndexMaskedTextBox.Text; var newAdress = new Adress() { adressType = adressType, city = city, postindex = postIndex, street = street }; var thisDeleteAdress = _crudStudent.GetAdress(_currentRowAdressIndex); _crudStudent.UpdateCurrentAdress(thisDeleteAdress, newAdress, _currentRowAdressIndex); AddRowsDataTableAdress(_crudStudent.GetAdressList(), _dataTableAdress); }