Beispiel #1
0
        public void RegistredChild(ChildModel model, string login)
        {
            Child child = new Child()
            {
                FirstName   = model.FirstName,
                LastName    = model.LastName,
                MiddleName  = model.MiddleName,
                DateOfBirth = model.DateOfBirth,
                Address     = new Address()
                {
                    City      = model.City,
                    House     = model.House,
                    Street    = model.Street,
                    Apartment = model.Apartment
                },
                BirthCertificate = new BirthCertificate()
                {
                    Number      = model.Number,
                    Description = model.Description,
                    Series      = model.Series
                },
            };

            _childRepository.AddChild(child, login, model.KindergartenNumber);
        }
Beispiel #2
0
        /// <summary>
        /// Saves the child to the repository.  This method is invoked by the SaveCommand.
        /// </summary>
        public void Save()
        {
            if (!_child.IsValid)
            {
                throw new InvalidOperationException(Strings.ChildViewModel_Exception_CannotSave);
            }

            if (this.IsNewChild)
            {
                _childRepository.AddChild(_child);
            }

            base.OnPropertyChanged("DisplayName");
        }