Пример #1
0
        private void AskAndDelete()
        {
            if (MessageBox.Show("Delete Selected Message ? [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            if (_message.Delete())
            {
                Alerts.Success("Message deleted successfully !!!");
                MessageToFile.Delete(_message);
            }
            else
            {
                Alerts.Warning("Unable to delete Message !!!");
            }
        }
Пример #2
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 !!!");
            }
        }
Пример #3
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 !!!");
            }
        }
Пример #4
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 !!!");
            }
        }
Пример #5
0
        private void AskAndInsert()
        {
            if (MessageBox.Show($"Send Message [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            _message.Subject = this["Subject"];
            _message.Body    = this["Body"];

            if (_message.Insert())
            {
                Alerts.Success("Message Sent successfully !!!");
                MessageToFile.Save(_message);
            }
            else
            {
                Alerts.Warning("Unable to Send Message !!!");
            }
        }
Пример #6
0
        private void AskAndUpdate()
        {
            if (MessageBox.Show("Edit Selected Message ? [y/n] ") == MessageBox.MessageBoxResult.No)
            {
                return;
            }

            _message.Subject = this["Subject"];
            _message.Body    = this["Body"];

            if (_message.Update())
            {
                Alerts.Success("Message Updated successfully !!!");
                MessageToFile.Save(_message);
            }
            else
            {
                Alerts.Warning("Unable to Update Message !!!");
            }
        }