private void Authenticate() { SecurityController s = HttpContext.Current.User as SecurityController; if (s != null) { MembershipLevelController mlc = new MembershipLevelController(); List <MembershipLevel> mls = mlc.SelectMembershipLevels(); bool ok = false; foreach (MembershipLevel m in mls) { if (s.IsInRole(m.Description)) { ok = true; } } if (!ok) { FormsAuthentication.SignOut(); Response.Redirect("login.aspx"); } } else { FormsAuthentication.SignOut(); Response.Redirect("login.aspx"); } }
public List <MembershipLevel> ReadMembershipLevels() { MembershipLevelController membershipLevels = new MembershipLevelController(); List <MembershipLevel> ml = membershipLevels.SelectMembershipLevels(); return(ml); }
public MembershipLevel ReadMembershipLevel(int membershipLevelID) { MembershipLevelController membershipLevels = new MembershipLevelController(); MembershipLevel ml = membershipLevels.SelectMembershipLevel(membershipLevelID); return(ml); }
public bool DeleteMembershipLevel(int membershipLevelID) { try { MembershipLevelController membershipLevels = new MembershipLevelController(); bool b = membershipLevels.DeleteMembershipLevel(membershipLevelID); return(b); } catch { return(false); } }
public bool UpdateMembershipLevel(int membershipLevelID, string description, int active) { try { MembershipLevelController membershipLevels = new MembershipLevelController(); bool b = membershipLevels.UpdateMembershipLevel(membershipLevelID, description, active); return(b); } catch { return(false); } }
public bool CreateMembershipLevel(string description) { try { MembershipLevelController membershipLevels = new MembershipLevelController(); bool b = membershipLevels.InsertMembershipLevel(description); return(b); } catch { return(false); } }