コード例 #1
0
    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");
        }
    }
コード例 #2
0
    public List <MembershipLevel> ReadMembershipLevels()
    {
        MembershipLevelController membershipLevels = new MembershipLevelController();
        List <MembershipLevel>    ml = membershipLevels.SelectMembershipLevels();

        return(ml);
    }
コード例 #3
0
    public MembershipLevel ReadMembershipLevel(int membershipLevelID)
    {
        MembershipLevelController membershipLevels = new MembershipLevelController();
        MembershipLevel           ml = membershipLevels.SelectMembershipLevel(membershipLevelID);

        return(ml);
    }
コード例 #4
0
 public bool DeleteMembershipLevel(int membershipLevelID)
 {
     try
     {
         MembershipLevelController membershipLevels = new MembershipLevelController();
         bool b = membershipLevels.DeleteMembershipLevel(membershipLevelID);
         return(b);
     }
     catch
     {
         return(false);
     }
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 public bool CreateMembershipLevel(string description)
 {
     try
     {
         MembershipLevelController membershipLevels = new MembershipLevelController();
         bool b = membershipLevels.InsertMembershipLevel(description);
         return(b);
     }
     catch
     {
         return(false);
     }
 }