示例#1
0
        private void AskAndDelete()
        {
            if (MessageBox.Show("Delete Selected User ? [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            if (_user.Delete(_loggedUser.UserId))
            {
                Alerts.Success("Account Deleted successfully !!!");
                OnFormSaved?.Invoke();
            }
            else
            {
                Alerts.Warning("Unable to Delete Account !!!");
            }
        }
示例#2
0
        private void AskAndInsert()
        {
            if (MessageBox.Show($"Sign Up [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            UpdateUserFromTextBoxes();

            if (_user.Insert())
            {
                Alerts.Success("Account Created successfully !!!");
                OnFormSaved?.Invoke();
            }
            else
            {
                Alerts.Warning("Unable to Create Account !!!");
            }
        }
示例#3
0
        private void AskAndUpdate()
        {
            if (MessageBox.Show("Update Selected User ? [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            UpdateUserFromTextBoxes();

            if (_user.Update())
            {
                Alerts.Success("Account Updated successfully !!!");
                OnFormSaved?.Invoke();
            }
            else
            {
                Alerts.Warning("Unable to Update Account !!!");
            }
        }