예제 #1
0
        /// <summary>
        /// 为商户游戏买分
        /// </summary>
        public bool SitePayMul(string IDs, decimal money)
        {
            string[] ids = IDs.Split("|");
            if (ids.Length == 0)
            {
                return(this.FaildMessage("请选择需要买分的游戏"));
            }

            using (DbExecutor db = NewExecutor(IsolationLevel.ReadUncommitted))
            {
                foreach (string id in ids)
                {
                    if (string.IsNullOrEmpty(id))
                    {
                        continue;
                    }

                    int             temp            = int.Parse(id);
                    SiteGameSetting sitegamesetting = this.ReadDB.ReadInfo <SiteGameSetting>(t => t.ID == temp);
                    sitegamesetting.Paid   += money;
                    sitegamesetting.Credit += money;

                    //添加买分日志
                    CreditLog creditLog = new CreditLog()
                    {
                        GameID       = sitegamesetting.GameID,
                        SiteID       = sitegamesetting.SiteID,
                        Type         = CreditLog.ChangeType.Add,
                        ChangeCredit = money,
                        Balance      = sitegamesetting.Paid,
                        OrderID      = sitegamesetting.ID.ToString(),
                        CreateAt     = DateTime.Now
                    };
                    sitegamesetting.Update(db, t => t.Paid, t => t.Credit);

                    creditLog.Add(db);
                }

                db.Commit();
            }
            return(this.AccountInfo.Log(SystemAdminLog.LogType.Site, $"买分成功"));
        }
예제 #2
0
        /// <summary>
        /// 为商户游戏买分
        /// </summary>
        public bool SitePay(int Id, decimal money)
        {
            SiteGameSetting sitegamesetting = this.ReadDB.ReadInfo <SiteGameSetting>(t => t.ID == Id);

            if (sitegamesetting == null)
            {
                return(this.FaildMessage("买分错误"));
            }
            if (money == 0)
            {
                return(this.FaildMessage("金额不能为0"));
            }

            sitegamesetting.Paid   += money;
            sitegamesetting.Credit += money;

            //添加买分日志
            CreditLog creditLog = new CreditLog()
            {
                GameID       = sitegamesetting.GameID,
                SiteID       = sitegamesetting.SiteID,
                Type         = CreditLog.ChangeType.Add,
                ChangeCredit = money,
                Balance      = sitegamesetting.Paid,
                OrderID      = sitegamesetting.ID.ToString(),
                CreateAt     = DateTime.Now
            };

            using (DbExecutor db = NewExecutor(IsolationLevel.ReadUncommitted))
            {
                sitegamesetting.Update(db, t => t.Paid, t => t.Credit);

                creditLog.Add(db);

                db.Commit();
            }
            return(this.AccountInfo.Log(SystemAdminLog.LogType.Site, $"修改商户游戏配置成功{Id}"));
        }