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


C# User.ToString方法代码示例

本文整理汇总了C#中LotteryVoteMVC.Models.User.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# User.ToString方法的具体用法?C# User.ToString怎么用?C# User.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LotteryVoteMVC.Models.User的用法示例。


在下文中一共展示了User.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Remove

 public void Remove(int dropId, User user)
 {
     if (user.Role != Role.Company) throw new NoPermissionException("删除跌水", user.ToString());
     var drop = DaDropWater.GetDropWater(dropId);
     if (drop != null)
     {
         DaDropWater.Delete(dropId);
         UpperLimitManager.GetManager().RefreshLimitNextLimit(drop.Num, drop.GamePlayWayId);
     }
 }
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:10,代码来源:DropWaterManager.cs

示例2: Add

 public void Add(LotteryCompany company, User user)
 {
     if (user.Role != Role.Company) throw new NoPermissionException("Add Company", user.ToString());
     DaCompany.Insert(company);
     LotterySystem.ClearAllCompany();
 }
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:6,代码来源:CompanyManager.cs

示例3: GetStatement

        /// <summary>
        /// 获取会员结单
        /// </summary>
        /// <param name="member">The member.</param>
        /// <returns></returns>
        public IEnumerable<BetOrder> GetStatement(User member, out BetOrder lastWeekTotal)
        {
            if (member.Role != Role.Guest) throw new NoPermissionException("获取会员结单", member.ToString());

            int dayCount = 14;
            int diffDay = 0;
            if (DateTime.Today.DayOfWeek == DayOfWeek.Sunday) diffDay = 7;
            else diffDay = (int)DateTime.Today.DayOfWeek;

            int count = diffDay + 7 > LotterySystem.Current.StatementOrderCount ? LotterySystem.Current.StatementOrderCount : diffDay + 7;
            var endDate = DateTime.Today.AddDays(-1 * count);
            var statememt = DaOrder.GetStatementOrder(member, dayCount);

            #region 获取上周总结

            var lastMonday = DateTime.Today.AddDays(-1 * (diffDay + 6));
            var lastSunday = lastMonday.AddDays(6);

            var lastWeekTotals = statememt.Where(it => it.CreateTime >= lastMonday && it.CreateTime <= lastSunday);
            lastWeekTotal = new BetOrder { CreateTime = lastSunday };
            foreach (var order in lastWeekTotals)
            {
                if (lastWeekTotal == null)
                {
                    lastWeekTotal = order;
                    lastWeekTotal.CreateTime = lastSunday;
                }
                else
                {
                    lastWeekTotal.Turnover += order.Turnover;
                    lastWeekTotal.Commission += order.Commission;
                    lastWeekTotal.NetWin += order.NetWin;
                    lastWeekTotal.DrawResult += order.DrawResult;
                    lastWeekTotal.CancelAmount += order.CancelAmount;
                }
            }
            #endregion

            var result = statememt.Where(it => it.CreateTime >= lastMonday);
            if (result.Count() < dayCount)
            {
                List<BetOrder> orders = new List<BetOrder>(result);
                List<DateTime> dates = new List<DateTime>();
                for (int i = 0; i < dayCount; i++)
                    dates.Add(DateTime.Today.AddDays(-1 * i));
                var notExistDate = dates.Except(result.Select(it => it.CreateTime));
                orders.AddRange(notExistDate.Select(it => new BetOrder { CreateTime = it }));
                result = orders;
            }
            int takeCount = (int)DateTime.Today.DayOfWeek + 7;
            if (takeCount > 10 || takeCount <= 7)
                takeCount = 10;
            return result.OrderBy(it => it.CreateTime).Skip(dayCount - takeCount).Take(count);
        }
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:59,代码来源:OrderManager.cs

示例4: Remove

 /// <summary>
 /// 删除开奖公司
 /// </summary>
 /// <param name="companyId">The company id.</param>
 /// <param name="user">The user.</param>
 public void Remove(int companyId, User user)
 {
     if (user.Role != Role.Company)
         throw new NoPermissionException("Delete company", user.ToString());
     DaCompany.Delete(companyId);
     LotterySystem.ClearAllCompany();        //清空公司列表缓存
 }
开发者ID:kinsen,项目名称:LotteryVoteMVC,代码行数:12,代码来源:CompanyManager.cs


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