Ejemplo n.º 1
0
        private async void BtnUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtEmail.Text) && string.IsNullOrEmpty(txtLastName.Text) && string.IsNullOrEmpty(txtFirstName.Text) && string.IsNullOrEmpty(txtPassword.Password) && string.IsNullOrEmpty(txtUsername.Text) && string.IsNullOrEmpty(txtTcNo.Text) && string.IsNullOrEmpty(txtPhoneNumber.Text) && string.IsNullOrEmpty(cmbGender.Text) && string.IsNullOrEmpty(cmbCity.Text) && string.IsNullOrEmpty(cmbJob.Text))
            {
                var msg = new MessageDialog("Eksik Veri Girişi Yaptınız Kontrol Ediniz.");
                await msg.ShowAsync();
            }
            else
            {
                var      date         = CdtDateBirth.Date;
                DateTime time         = date.Value.DateTime;
                var      formatedtime = time.ToString("dd.mm.yyyy");
                await client.EditUserAsync(new User
                {
                    UserID      = user.UserID,
                    UserName    = txtUsername.Text,
                    TcNo        = txtTcNo.Text,
                    Phone       = txtPhoneNumber.Text,
                    Password    = txtPassword.Password,
                    LastName    = txtLastName.Text,
                    FirstName   = txtFirstName.Text,
                    Email       = txtEmail.Text,
                    Gender      = cmbGender.SelectedValue.ToString(),
                    City        = cmbCity.SelectedValue.ToString(),
                    Job         = cmbJob.SelectedValue.ToString(),
                    DateOfBirth = Convert.ToDateTime(time.ToShortDateString())
                });

                var ms = new MessageDialog("Güncelleme İşlemeniz Başarıyla Gerçekleşti");
                await ms.ShowAsync();
            }
        }