本文整理汇总了C#中LotteryVoteMVC.Models.User类的典型用法代码示例。如果您正苦于以下问题:C# User类的具体用法?C# User怎么用?C# User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
User类属于LotteryVoteMVC.Models命名空间,在下文中一共展示了User类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 }
});
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:41,代码来源:AutoBetOrderBuilder.cs
示例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;
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:ShadowModel.cs
示例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));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:12,代码来源:AgentAuthorizeActionDataAccess.cs
示例4: AddMemberPackage
private void AddMemberPackage(User user, IEnumerable<CommissionGroup> groups)
{
foreach (var group in groups)
{
CommManager.AddMemberPackage(user, group);
}
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:MemberStrategy.cs
示例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);
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:ActionLogDataAccess.cs
示例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);
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:UserManager.cs
示例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);
});
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:30,代码来源:UserLimitManager.cs
示例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);
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:BetSheetDataAccess.cs
示例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);
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:UserDataAccess.cs
示例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));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:MemberPackageDataAccess.cs
示例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));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:7,代码来源:LoginFailedLogDataAccess.cs
示例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;
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:34,代码来源:UserNameBuilder.cs
示例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));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:13,代码来源:CommissionValueDataAccess.cs
示例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);
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:8,代码来源:LoginFailedLogDataAccess.cs
示例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));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:8,代码来源:MemberPackageDataAccess.cs
示例16: GetMemebersCommGroup
public CommissionGroup GetMemebersCommGroup(User member, LotterySpecies specie)
{
string sql = string.Format(@"select cg.* from tb_CommissionGroup cg
join tb_MemberPackage mpa on mpa.GroupId=cg.GroupId
where mpa.{0}[email protected]{0} and mpa.{1}[email protected]{1}", MemberPackage.USERID, MemberPackage.SPECIEID);
return base.ExecuteModel<CommissionGroup>(sql, new SqlParameter(MemberPackage.USERID, member.UserId),
new SqlParameter(MemberPackage.SPECIEID, (int)specie));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:8,代码来源:CommissionGroupDataAccess.cs
示例17: GetCommissionValue
/// <summary>
/// 获取用户特定市场的佣金差
/// </summary>
/// <param name="user">The user.</param>
/// <param name="specie">The specie.</param>
/// <returns></returns>
public IEnumerable<CommissionValue> GetCommissionValue(User user, LotterySpecies specie)
{
string sql = string.Format(@"SELECT CV.* FROM {0} CV
JOIN {1} UC on UC.{3}=cv.{2}
where UC.{4}[email protected]{4} and UC.{5}[email protected]{5}", CommissionValue.TABLENAME, UserCommission.TABLENAME, CommissionValue.COMMISSIONID,
UserCommission.COMMISSIONID, UserCommission.USERID, UserCommission.SPECIEID);
return base.ExecuteList<CommissionValue>(sql, new SqlParameter(UserCommission.USERID, user.UserId),
new SqlParameter(UserCommission.SPECIEID, (int)specie));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:15,代码来源:CommissionValueDataAccess.cs
示例18: BuildOrder
public IDictionary<BetSheet, IList<BetOrder>> BuildOrder(User user, LotterySpecies specie,
IEnumerable<AutoBetItem> betList, IDictionary<string, object> parameters)
{
this._betResult = new BetResult();
BetResult returnResult = new Models.BetResult();
var todayLotteryCompany = TodayLotteryCompany.Instance.GetTodayCompany(); //获取今日开奖公司
var memberComm = CommManager.GetMemberCommissionInSession(user, specie); //获取会员的佣金
IDictionary<BetSheet, IList<BetOrder>> betSheetDic = new Dictionary<BetSheet, IList<BetOrder>>();
IDictionary<BetSheet, IList<BetOrder>> resultDic = new Dictionary<BetSheet, IList<BetOrder>>();
foreach (var betOrder in betList)
{
int[] nums;
switch (betOrder.BetType)
{
case AutoBetType.TwelveZodiac: nums = LotterySystem.Current.TwelveZodiac; break;
case AutoBetType.EvenEven: nums = LotterySystem.Current.EvenEven; break;
case AutoBetType.EvenOdd: nums = LotterySystem.Current.EvenOdd; break;
case AutoBetType.OddEven: nums = LotterySystem.Current.OddEven; break;
case AutoBetType.OddOdd: nums = LotterySystem.Current.OddOdd; break;
case AutoBetType.Small: nums = LotterySystem.Current.Small; break;
case AutoBetType.Big: nums = LotterySystem.Current.Big; break;
default: throw new InvalidDataException("不可到达,数据异常!");
}
var sheet = BuildAutoElectionCodeOrder(user, specie, betOrder.CompanyList, betOrder.WagerList, nums);
betSheetDic.AddRange(sheet);
returnResult.Append(this.BetResult);
List<BetOrder> orderList = new List<BetOrder>();
foreach (var item in betSheetDic)
orderList.AddRange(item.Value);
StringBuilder companySb = new StringBuilder();
foreach (var companyId in betOrder.CompanyList)
{
var company = todayLotteryCompany.Find(it => it.CompanyId == companyId);
if (company == null)
throw new InvalidDataException("CompanyId:" + companyId);
companySb.AppendFormat("{0} ", company.Abbreviation);
}
BetSheet orderSheet = new BetSheet
{
Num = betOrder.BetType.ToString(),
Turnover = orderList.Sum(it => it.Turnover),
NetAmount = orderList.Sum(it => it.NetAmount),
Commission = orderList.Sum(it => it.Commission),
UserId = user.UserId,
Status = BetStatus.Valid,
IPAddress = IPHelper.IPAddress,
BetCompany = companySb.ToString(),
BetAmount = JoinSheetBetAmount(sheet.Keys)
};
resultDic.Add(orderSheet, orderList);
betSheetDic.Clear();
}
this._betResult = returnResult;
return resultDic;
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:56,代码来源:AutoBetOrderBuilder.cs
示例19: GetLog
public IEnumerable<LoginFailedLog> GetLog(User user, int start, int end)
{
string sql = string.Format(@"SELECT * FROM
(
SELECT ROW_NUMBER() OVER(ORDER BY LogId desc) AS RowNumber,*
FROM {0} WHERE {1}[email protected]{1}
) T
WHERE RowNumber BETWEEN {2} AND {3}", LoginFailedLog.TABLENAME, LoginFailedLog.USERID, start, end);
return base.ExecuteList<LoginFailedLog>(sql, new SqlParameter(LoginFailedLog.USERID, user.UserId));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:10,代码来源:LoginFailedLogDataAccess.cs
示例20: UpdateFamilyState
/// <summary>
/// 修改家族状态(以传入用户为根节点)
/// </summary>
/// <param name="user">The user.</param>
/// <param name="state">The state.</param>
public void UpdateFamilyState(User user, UserState state)
{
string sql = string.Format(@";WITH CTE AS(
SELECT * FROM tb_User WHERE {0}[email protected]{0}
UNION ALL
SELECT B.* FROM tb_User AS B,CTE AS C
WHERE B.parentId=C.UserId and B.UserId>C.UserId)
update tb_UserInfo set {1}[email protected]{1} where UserId in (select UserId from CTE)", User.USERID, UserInfo.STATE);
base.ExecuteNonQuery(sql, new SqlParameter(User.USERID, user.UserId), new SqlParameter(UserInfo.STATE, (int)state));
}
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:15,代码来源:UserInfoDataAccess.cs
注:本文中的LotteryVoteMVC.Models.User类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论