private void MetroButtonDelete_Click(object sender, EventArgs e)
        {
            int deleteID = Convert.ToInt32(metroLabelMemberId.Text);

            if (metroLabelMemberId.Text != "0" && metroLabelMemberId.Text != null && isValidDelete(deleteID))
            {
                using (var context = new KucsaManagementDatabaseEntities())
                {
                    var delUser = new TblMember {
                        MemberId = deleteID
                    };
                    context.TblMembers.Attach(delUser);
                    context.TblMembers.Remove(delUser);
                    context.SaveChanges();
                    MetroMessageBox.Show(this, delUser.MemberName + " Removed Successfully from the system!", "Successful Removal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    LoadMembers();
                }
            }
        }
        private void AddNewMember()
        {
            using (var context = new KucsaManagementDatabaseEntities())
            {
                TblMember member = new TblMember
                {
                    MemberName         = memberName,
                    MemberRegistration = memberReg,
                    Password           = memberPass,
                    MemberThumbnail    = bigPicture,
                    MemberBigPicture   = bigPicture,
                    RoleId             = Convert.ToInt32(MetroComboBoxRole.SelectedValue),
                    CourseId           = Convert.ToInt32(MetroComboBoxMemberCourse.SelectedValue),
                    ModuleId           = Convert.ToInt32(MetroComboBoxMemberModule.SelectedValue)
                };

                if (!isValidRegistrationNo(memberReg))
                {
                    MetroMessageBox.Show(this, "The registration number entered already exists!", "Unsuccessful Operation!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    context.TblMembers.Add(member);

                    try
                    {
                        context.SaveChanges();
                        MetroMessageBox.Show(this, memberName + " Added Successfully as a member!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    catch (Exception)
                    {
                        MetroMessageBox.Show(this, "Could not save a new user", "Unsuccessful Operation!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }