Ejemplo n.º 1
0
        private void Update()
        {
            ClassLibrary.Objects.Person person = this.GetPersonFromView();
            var repository = new PersonRepository();

            repository.Update(person);
        }
Ejemplo n.º 2
0
        private void Add()
        {
            ClassLibrary.Objects.Person person = this.GetPersonFromView();
            var repository = new PersonRepository();

            repository.Add(person);
            this.PersonIdField = person.Id;
        }
Ejemplo n.º 3
0
        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;
        }