本文整理汇总了C#中Bobs.Usr.IsPromoterK方法的典型用法代码示例。如果您正苦于以下问题:C# Usr.IsPromoterK方法的具体用法?C# Usr.IsPromoterK怎么用?C# Usr.IsPromoterK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bobs.Usr
的用法示例。
在下文中一共展示了Usr.IsPromoterK方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsUsrAllowedAccess
public bool IsUsrAllowedAccess(Usr usr)
{
return usr.IsAdmin || ((this.PromoterK > 0 && usr.IsPromoter && usr.IsPromoterK(this.PromoterK)) || (this.PromoterK == 0 && this.UsrK > 0 && usr.K == this.UsrK));
}
示例2: IsPromoter
public bool IsPromoter(Usr user)
{
foreach (Brand b in this.Brands)
{
if (user.IsPromoterK(b.PromoterK))
return true;
}
if (user.IsPromoterK(this.Venue.PromoterK))
return true;
return false;
}
示例3: SetUsrAndActionUsr
public void SetUsrAndActionUsr(Usr CurrentUsr, bool overrideExisting)
{
if (this.PromoterK > 0)
{
if (CurrentUsr.IsPromoterK(this.PromoterK))
this.UsrK = CurrentUsr.K;
else if (this.Promoter != null && this.Promoter.PrimaryUsrK != 0)
{
// For instance when an admin does it on a promoter's behalf
this.UsrK = this.Promoter.PrimaryUsrK;
}
else
this.UsrK = CurrentUsr.K;
}
// If there is no Promoter
else if(overrideExisting || this.UsrK == 0)
{
this.UsrK = CurrentUsr.K;
}
if (overrideExisting || this.ActionUsrK == 0)
this.ActionUsrK = CurrentUsr.K;
}
示例4: IsUsrAllowedAccess
public bool IsUsrAllowedAccess(Usr usr)
{
return usr.IsAdmin || (this.K > 0 && usr.IsPromoter && usr.IsPromoterK(this.K));
}