예제 #1
0
파일: Member.cs 프로젝트: Abnertd/public
    public void Update_MemberGrade()
    {
        MemberInfo memberinfo = GetMemberByID();
        QueryInfo  Query      = new QueryInfo();

        Query.PageSize    = 0;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "MemberGradeInfo.Member_Grade_Site", "=", "CN"));
        //Query.ParamInfos.Add(new ParamInfo("AND", "int", "MemberGradeInfo.Member_Grade_ID", "<>", "2"));
        Query.OrderInfos.Add(new OrderInfo("MemberGradeInfo.Member_Grade_RequiredCoin", "desc"));
        IList <MemberGradeInfo> grades = Mygrade.GetMemberGrades(Query, pub.CreateUserPrivilege("1c955ea6-881f-48d8-ba8d-c5aa7ce9cfea"));

        if (grades != null)
        {
            foreach (MemberGradeInfo grade in grades)
            {
                if (memberinfo.Member_CoinCount >= grade.Member_Grade_RequiredCoin)
                {
                    memberinfo.Member_Grade = grade.Member_Grade_ID;
                    Session["member_grade"] = memberinfo.Member_Grade;
                    MyMember.EditMember(memberinfo, pub.CreateUserPrivilege("079ec5fc-33fe-4d58-a17f-14b5877b4ffe"));
                    break;
                }
            }
        }
    }