示例#1
0
 private void updateRankByOther_private(IRole rank, int i, SiteRankOther otherRank)
 {
     string[] arrRanks = otherRank.Ranks.Split('/');
     if (arrRanks.Length > i)
     {
         rank.Name = arrRanks[i];
         UpdateRank(rank as SiteRank);
     }
 }
示例#2
0
        public virtual void SetRanksByOther(long id)
        {
            SiteRankOther otherRank = roleService.GetRankOtherById(id);

            roleService.UpdateRankByOther(otherRank);
            log(SiteLogString.SetRanksByOther());

            echoToParentPart(lang("opok"));
        }
示例#3
0
        public virtual void UpdateRankByOther(SiteRankOther otherRank)
        {
            List <SiteRank> rankAll = this.GetRankAll();

            for (int i = 0; i < rankAll.Count; i++)
            {
                IRole rank = rankAll[i];
                this.updateRankByOther_private(rank, i, otherRank);
            }

            if (otherRank.RankCount > rankAll.Count)
            {
                for (int i = rankAll.Count; i < otherRank.RankCount; i++)
                {
                    SiteRank rank = new SiteRank();
                    rank.Name = otherRank.GetName(i);
                    InsertRank(rank);
                }
            }
        }