当前位置: 首页>>代码示例>>C#>>正文


C# Models.User类代码示例

本文整理汇总了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 }
                });
        }
开发者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


注:本文中的LotteryVoteMVC.Models.User类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。