Ejemplo n.º 1
0
        private void DeleteHistoryBtn_Click(object sender, RoutedEventArgs e)
        {
            if (!this.Username.Equals(this.UsernameHistory.Text))
            {
                return;
            }
            User userByUsername = CryptoLinq.Users.First(u => u.username.Equals(Username));

            CryptoLinq.ExecuteCommand("DELETE FROM dbo.history where user_Id = {0}", userByUsername.Id);
            CryptoLinq.SubmitChanges();
            DeleteHistoryLabel.Content = "History deleted with success!";
            this.HistoryGrid.Items.Clear();
        }
Ejemplo n.º 2
0
        private void SaveUser()
        {
            User newUser = new User();

            newUser.username = Username.Text;
            newUser.email    = Email.Text;
            newUser.password = Utils.EncryptPassword(Password.Password);
            cryptoLinq.Users.InsertOnSubmit(newUser);

            cryptoLinq.SubmitChanges();
            EmailSender.SendEmail(newUser.email, newUser.username);
            this.NavigationService.Navigate(new Uri("Login.xaml", UriKind.Relative));
        }