private void initProfile() { userProfile = ProfileDatabase.GetProfile(user); tbNameProfile.Text = userProfile.Name; tbPhoneProfile.Text = userProfile.Phone; tbEmailProfile.Text = userProfile.Email; tbEmailProfile.IsEnabled = false; tbAddress.Text = userProfile.Address; tbHint.Text = userProfile.Hint; cbGender.SelectedIndex = userProfile.Gender; string date = userProfile.Date; if (String.IsNullOrEmpty(date)) { Helpers.shortDateFormating(); myDate = DateTime.Today; } else { Helpers.shortDateFormating(); myDate = DateTime.Parse(date); } if (userProfile.Avatar != null) { imgAvatarMini.ImageSource = Helpers.ConvertByteToImageBitmap(userProfile.Avatar); } }
private void initOwner() { UserProfile profile = ProfileDatabase.GetProfile(owner); NameOwner = "Hello " + profile.Name; if (profile.Avatar != null) { ImageOwner = Helpers.ConvertByteToImageBitmap(profile.Avatar); } }
private void TimerOnTick(object sender, EventArgs e) { try { if (isValidAccount(tbEmailReset.Text.Trim(), tbPasswordReset.Password.Trim(), tbConfirmPassReset.Password.Trim())) { user.Email = tbEmailReset.Text.Trim(); try { UserProfile userProfile = ProfileDatabase.GetProfile(user); if (userProfile != null) { if (userProfile.Hint.Equals(lbAnswerReset.Text.Trim())) { user.Password = tbPasswordReset.Password.Trim(); UserDatabase.Update(user, user.Email); Helpers.MakeConfirmMessage(Window.GetWindow(this), "Reset Password Successfully~", "Notify"); } else { Helpers.MakeErrorMessage(Window.GetWindow(this), "Hint is not correct", "Error"); } } else { Helpers.MakeErrorMessage(Window.GetWindow(this), "Email not exists", " Error "); } } catch (Exception eh) { Helpers.MakeErrorMessage(Window.GetWindow(this), "Error", "ERROR PROCESSING...."); } } dispatcherTimer.Stop(); icLoading.Visibility = Visibility.Collapsed; } catch (Exception er) { } }