Beispiel #1
0
        private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if ((PbPassword1.Password != PbPassword2.Password) || PbPassword1.Password.Equals(String.Empty) || (TbMail.Text.Equals(String.Empty) && TbPhoneNumber.Text.Equals(String.Empty)))
            {
                args.Cancel = true;
                return;
            }

            if (!TbMail.Text.Equals(String.Empty))
            {
                if (!CheckForm.IsMail(TbMail.Text))
                {
                    args.Cancel = true;
                    return;
                }
            }

            if (!CheckForm.IsPasspordId(TbPassportID.Text))
            {
                args.Cancel = true;
                return;
            }

            Client = new Client()
            {
                FirstName   = TbFirstName.Text,
                LastName    = TbLastName.Text,
                Patronymic  = TbPatronymic.Text,
                PassportID  = TbPassportID.Text,
                Mail        = TbMail.Text == String.Empty ? null : TbMail.Text,
                PhoneNumber = TbPhoneNumber.Text == String.Empty ? null : TbPhoneNumber.Text,
                Password    = PbPassword1.Password
            };
        }