Beispiel #1
0
        private void logout_button_Click(object sender, EventArgs e)
        {
            CustomMessage msg = new CustomMessage();

            if (msg.Show("Are you sure you want to log out?", MessageDialogButtons.YesNo, MessageDialogIcon.Question) == DialogResult.Yes)
            {
                this.Hide();
            }
        }
        private void delete_button_Click(object sender, EventArgs e)
        {
            CustomMessage msg = new CustomMessage();

            if (msg.Show("Are you sure you want to delete this profile?", MessageDialogButtons.YesNoCancel, MessageDialogIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    dh.deleteBloodDonor(ProfileID);
                    this.Close();
                }
                catch
                {
                    dh.conn.Close();
                    Notification.Show(State.PersonHasDonations);
                }
            }
        }
Beispiel #3
0
        private void delete_button_Click(object sender, EventArgs e)
        {
            User u = User.getCurrentUser();

            if (u.userPrivilegeLevel == UserPrivileges.Admin)
            {
                CustomMessage msg = new CustomMessage();
                if (msg.Show("Are you sure you want to delete this event?", MessageDialogButtons.YesNoCancel, MessageDialogIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        dh.deleteBloodDonationEvent(bloodlettingID);
                        close_button.PerformClick();
                    }
                    catch
                    {
                        dh.conn.Close();
                        Notification.Show(State.CannotDeleteBloodEvent);
                    }
                }
            }
            else if (AdminCredentialDialog.Show() == DialogResult.Yes)
            {
                CustomMessage msg = new CustomMessage();
                if (msg.Show("Are you sure you want to delete this event?", MessageDialogButtons.YesNoCancel, MessageDialogIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        dh.deleteBloodDonationEvent(bloodlettingID);
                        close_button.PerformClick();
                    }
                    catch
                    {
                        dh.conn.Close();
                        Notification.Show(State.CannotDeleteBloodEvent);
                    }
                }
            }
        }
Beispiel #4
0
        public static DialogResult Show(string information, string title, MessageDialogButtons b = MessageDialogButtons.OK, MessageDialogIcon i = MessageDialogIcon.Information)
        {
            CustomMessage cm = new CustomMessage();

            return(cm.Show(information, title, b, i));
        }
Beispiel #5
0
        public static DialogResult Show(State s)
        {
            CustomMessage cm = new CustomMessage();

            return(cm.Show(s._msg, s._btn, s._icon));
        }