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 ); } }
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 ); } } }