Пример #1
0
 public static Person CreatePerson(PersonModel ps)
 {
     Person temp = new Person();
     temp.id = ps.id;
     temp.name = ps.name;
     temp.surname = ps.surname;
     temp.area_code = ps.area_code;
     temp.email = ps.email;
     temp.id_section = ps.id_section;
     temp.phone_number = ps.phone_number;
     temp.phone_number2 = ps.phone_number2;
     return temp;
 }
Пример #2
0
 public static PersonModel CreatePersonSection(Person person)
 {
     SectionMethods sm = new SectionMethods();
     PersonModel temp;
     temp = new PersonModel();
     temp.id = person.id;
     temp.name = person.name;
     temp.surname = person.surname;
     temp.phone_number = person.phone_number;
     temp.phone_number2 = person.phone_number2;
     temp.area_code = person.area_code;
     temp.email = person.email;
     temp.id_section = person.id_section;
     temp.short_section_name = sm.GetShortNameById(person.id_section);
     return temp;
 }
Пример #3
0
 public static ObservableCollection<PersonModel> CreatePersonSectionList(object[] table)
 {
     SectionMethods sm = new SectionMethods();
     ObservableCollection<PersonModel> personsectionList = new ObservableCollection<PersonModel>();
     PersonModel temp;
     foreach (Person person in table)
     {
         temp = new PersonModel();
         temp.id = person.id;
         temp.name = person.name;
         temp.surname = person.surname;
         temp.phone_number = person.phone_number;
         temp.phone_number2 = person.phone_number2;
         temp.area_code = person.area_code;
         temp.email = person.email;
         temp.id_section = person.id_section;
         temp.short_section_name = sm.GetShortNameById(person.id_section);
         personsectionList.Add(temp);
     }
     return personsectionList;
 }
 private void ChangeCurrentRow(PersonPresenter presenterPerson,PersonEditPresenter presenterEdit, PersonModel obj)
 {
     SectionMethods sm = new SectionMethods(); 
     PersonModel ps = ((PersonModel)presenterEdit.View.DataContext);
     obj.area_code = ps.area_code;
     obj.id_section = ps.id_section;
     obj.name = ps.name;
     obj.phone_number = ps.phone_number;
     obj.phone_number2 = ps.phone_number2;
     obj.short_section_name = sm.GetShortNameById(ps.id_section);
     obj.surname = ps.surname;
     obj.email = ps.email;
     presenterPerson.View.dataGridPersons.Items.Refresh();
 }