本文整理汇总了C#中LotteryVoteMVC.Models.User类的典型用法代码示例。如果您正苦于以下问题:C# User类的具体用法?C# User怎么用?C# User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
User类属于LotteryVoteMVC.Models命名空间,在下文中一共展示了User类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildAutoElectionCodeOrder
/// <summary>
/// 创建自动选码注单.
/// </summary>
/// <param name="user">The user.</param>
/// <param name="specie">The specie.</param>
/// <param name="companys">The companys.</param>
/// <param name="wagers">The wagers.</param>
/// <param name="nums">The nums.</param>
/// <returns></returns>
private IDictionary<BetSheet, IList<BetOrder>> BuildAutoElectionCodeOrder(User user, LotterySpecies specie,
int[] companys, IList<KeyValuePair<PlayWay, decimal>> wagers, int[] nums)
{
PlayWay[] allowBetPlayWay = new[] { PlayWay.Head, PlayWay.Last, PlayWay.HeadAndLast, PlayWay.Roll };
List<BetItem> betList = new List<BetItem>();
var wagerItems = new List<WagerItem>();
foreach (var wager in wagers)
{
if (!allowBetPlayWay.Contains(wager.Key)) continue;
var gpw = LotterySystem.Current.FindGamePlayWay(GameType.TwoDigital, wager.Key);
wagerItems.Add(new WagerItem
{
GamePlayTypeId = gpw.Id,
IsFullPermutation = false,
Wager = wager.Value
});
}
nums.ForEach(num =>
{
betList.Add(new BetItem
{
Num = num.ToString("D2"),
CompanyList = companys,
WargerList = wagerItems
});
});
return base.BuildOrder(user, specie, betList,
new Dictionary<string, object> {
{ "ISCON", LotterySystem.Current.AutoElectionCodeCommission > 0 }
});
}
示例2: ShadowModel
public ShadowModel(User user)
{
this.UserName = user.UserName;
this.Name = user.UserInfo.Name;
this.State = user.UserInfo.State;
this.Email = user.UserInfo.Email;
}
示例3: GetAuthByUser
/// <summary>
/// 根据用户获取他授权的操作
/// </summary>
/// <param name="user">The user.</param>
/// <returns></returns>
public IEnumerable<AgentAuthorizeAction> GetAuthByUser(User user)
{
string sql = string.Format(@"select aaa.* from tb_ShadowAuthorizeAction saa
join tb_AgentAuthorizeAction aaa on aaa.AuthorizeId=saa.AuthorizeId
where saa.{0}[email protected]{0}", ShadowAuthorizeAction.USERID);
return base.ExecuteList<AgentAuthorizeAction>(sql, new SqlParameter(ShadowAuthorizeAction.USERID, user.UserId));
}
示例4: AddMemberPackage
private void AddMemberPackage(User user, IEnumerable<CommissionGroup> groups)
{
foreach (var group in groups)
{
CommManager.AddMemberPackage(user, group);
}
}
示例5: CountActionLog
public int CountActionLog(User target, DateTime fromDate, DateTime toDate)
{
string condition = target == null ? string.Empty : string.Format(" And {0}={1}", ActionLog.TARGETUSERID, target.UserId);
string sql = string.Format(@"SELECT COUNT(0) FROM {0} WHERE CAST({2} as DATE) between CAST(@FromDate AS DATE) and CAST(@ToDate AS DATE) {1}", ActionLog.TABLENAME, condition, ActionLog.CREATETIME);
object count = base.ExecuteScalar(sql, new SqlParameter("FromDate", fromDate), new SqlParameter("ToDate", toDate));
return Convert.ToInt32(count);
}
示例6: AddMaster
public void AddMaster(User user, IEnumerable<LotterySpecies> species)
{
var userStrategy = UserStrategyFactory.GetFactory().GetUserStrategy(Role.Master, this);
userStrategy.AddParam(UserStrategy.ROLE, Role.Master);
userStrategy.AddParam(UserStrategy.SPECIES, species);
userStrategy.AddUser(user);
}
示例7: UpdateBetLimit
/// <summary>
/// 更新用户下注限制(先删除,再插入)
/// </summary>
/// <param name="user">The user.</param>
/// <param name="limits">The limits.</param>
public void UpdateBetLimit(User user, IEnumerable<BetLimit> limits)
{
if (user.Role > Role.Company)
{
var parentLimits = DaBetLimit.ListLimitByUser(user.ParentId);
foreach (var plimit in parentLimits)
{
var limit = limits.Find(it => it.GameId == plimit.GameId);
if (limit == null)
throw new InvalidDataException("limit", string.Format("不存在GameType:{0}的限制,UserId:{1}", plimit.GameType, user.UserId));
if (limit.LeastLimit < plimit.LeastLimit || limit.LargestLimit > plimit.LargestLimit)
{
var desc = EnumHelper.GetEnumDescript(plimit.GameType).Description;
string message = string.Format(Resources.Models.ModelResource.OverOutRange, desc, plimit.LeastLimit, plimit.LargestLimit);
throw new BusinessException(message);
}
}
}
limits = limits.ForEach(it => { it.UserId = user.UserId; return it; });
DaBetLimit.ExecuteWithTransaction(() =>
{
DaBetLimit.DeleteLimit(user);
DaBetLimit.InsertLimits(limits);
});
}
示例8: CountBetSheet
public int CountBetSheet(User user, DateTime date, params BetStatus[] status)
{
string sql = string.Format(@"SELECT COUNT(0) FROM {0} WHERE {1}[email protected]{1} AND CONVERT(char(10),{2},120)=CONVERT(char(10),@{2},120) AND Status in {3}", BetSheet.TABLENAME, BetSheet.USERID, BetSheet.CREATETIME, getStatusInStatement(status));
object count = base.ExecuteScalar(sql, new SqlParameter(BetSheet.USERID, user.UserId),
new SqlParameter(BetSheet.CREATETIME, date));
return Convert.ToInt32(count);
}
示例9: CountShadow
public int CountShadow(User user)
{
string sql = string.Format(@"SELECT COUNT(0) FROM {0} WHERE {1}[email protected]{1} AND {2}[email protected]{2}", User.TABLENAME, User.PARENTID, User.ROLEID);
object count = base.ExecuteScalar(sql, new SqlParameter(User.PARENTID, user.UserId),
new SqlParameter(User.ROLEID, (int)Role.Shadow));
return Convert.ToInt32(count);
}
示例10: GetMemberPackageBySpecie
public MemberPackage GetMemberPackageBySpecie(User user, LotterySpecies specie)
{
string sql = string.Format(@"SELECT * FROM {0} WHERE {1}[email protected]{1} AND {2}[email protected]{2}", MemberPackage.TABLENAME, MemberPackage.USERID, MemberPackage.SPECIEID);
return base.ExecuteModel<MemberPackage>(sql,
new SqlParameter(MemberPackage.USERID, user.UserId),
new SqlParameter(MemberPackage.SPECIEID, (int)specie));
}
示例11: Insert
public void Insert(User user)
{
string sql = string.Format(@"INSERT INTO {0} ({1},{2}) VALUES (@{1},@{2}) SELECT SCOPE_IDENTITY()", LoginFailedLog.TABLENAME,
LoginFailedLog.USERID, LoginFailedLog.IPField);
base.ExecuteScalar(sql, new SqlParameter(LoginFailedLog.USERID, user.UserId),
new SqlParameter(LoginFailedLog.IPField, IPHelper.IPAddress));
}
示例12: GetNextUserName
public string GetNextUserName(User currentUser, bool isBuildShadow = false)
{
_current = string.Empty;
if (isBuildShadow)
{
int childCount = UserManager.DaUser.CountShadow(currentUser) + 1;
_current = string.Format("{0}@{1}", childCount, currentUser.UserName);
if (UserManager.DaUser.GetUserByUserName(_current) != null)
_current = string.Format("{0}[email protected]{1}", childCount, currentUser.UserName);
}
else
{
int childCount = UserManager.DaUser.CountChild(currentUser);
if (currentUser.Role < Role.Agent)
{
if (childCount > 0)
Parse(childCount);
else
_current = "AA";
if (_current.Length == 1)
_current = "A" + _current;
if (currentUser.Role == Role.Company)
_current = "VD" + _current;
else
_current = currentUser.UserName + _current;
}
else
_current = currentUser.UserName + childCount.ToString("D3");
if (UserManager.DaUser.GetUserByUserName(_current) != null)
_current+=1;
}
return _current;
}
示例13: DeleteCommValues
/// <summary>
/// 根据用户和市场删除特定的佣金差
/// </summary>
/// <param name="user">The user.</param>
/// <param name="specie">The specie.</param>
public void DeleteCommValues(User user, LotterySpecies specie)
{
string sql = string.Format(@"delete {0} where {1}=(select {3} from {2} where {4}[email protected]{4} and {5}[email protected]{5})",
CommissionValue.TABLENAME, CommissionValue.COMMISSIONID, UserCommission.TABLENAME, UserCommission.COMMISSIONID,
UserCommission.USERID, UserCommission.SPECIEID);
base.ExecuteNonQuery(sql, new SqlParameter(UserCommission.USERID, user.UserId),
new SqlParameter(UserCommission.SPECIEID, (int)specie));
}
示例14: GetFailedCount
public int GetFailedCount(User user, DateTime date)
{
string sql = string.Format(@"SELECT COUNT(0) FROM {0} WHERE {1}[email protected]{1} AND CONVERT(char(10),{2},120)=CONVERT(char(10),@{2},120)",
LoginFailedLog.TABLENAME, LoginFailedLog.USERID, LoginFailedLog.CREATEDATE);
object count = base.ExecuteScalar(sql, new SqlParameter(LoginFailedLog.USERID, user.UserId),
new SqlParameter(LoginFailedLog.CREATEDATE, date));
return Convert.ToInt32(count);
}
示例15: InsertMemberPackage
public void InsertMemberPackage(User user, CommissionGroup group)
{
string sql = string.Format(@"INSERT INTO {0} ({1},{2},{3}) VALUES (@{1},@{2},@{3})",
MemberPackage.TABLENAME, MemberPackage.USERID, MemberPackage.GROUPID, MemberPackage.SPECIEID);
base.ExecuteNonQuery(sql, new SqlParameter(MemberPackage.USERID, user.UserId),
new SqlParameter(MemberPackage.GROUPID, group.GroupId),
new SqlParameter(MemberPackage.SPECIEID, group.SpecieId));
}