private void Update() { ClassLibrary.Objects.Person person = this.GetPersonFromView(); var repository = new PersonRepository(); repository.Update(person); }
private void Add() { ClassLibrary.Objects.Person person = this.GetPersonFromView(); var repository = new PersonRepository(); repository.Add(person); this.PersonIdField = person.Id; }
private void LoadPerson() { var repository = new PersonRepository(); ClassLibrary.Objects.Person person = repository.GetById(this.PersonIdField); this.FirstNameTextBox.Text = person.FirstName; this.LastNameTextBox.Text = person.LastName; this.EmailTextBox.Text = person.EmailAddress; this.PhoneTextBox.Text = person.PhoneNumber; this.BirthdayTextBox.Text = person.Birthday.HasValue ? person.Birthday.Value.ToShortDateString() : string.Empty; this.NotesTextBox.Text = person.Notes; this.CompanyDropDownList.SelectedValue = person.CompanyId.ToString(); this.DeleteButton.Visible = true; }