Example #1
0
        /// <summary>
        /// 获取推广配置实体
        /// </summary>
        /// <returns></returns>
        public GlobalSpreadInfo GetGlobalSpreadInfo()
        {
            string           sql   = "SELECT TOP 1 * FROM GlobalSpreadInfo ORDER BY ID DESC";
            GlobalSpreadInfo model = Database.ExecuteObject <GlobalSpreadInfo>(sql);

            return(model);
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //判断权限
            AuthUserOperationPermission(Permission.Edit);
            double           FillGrantRate = CtrlHelper.GetInt(txtFillGrantRate, 0);
            double           BalanceRate   = CtrlHelper.GetInt(txtBalanceRate, 0);
            GlobalSpreadInfo spread        = FacadeManage.aideTreasureFacade.GetGlobalSpreadInfo(1);

            spread.RegisterGrantScore = CtrlHelper.GetInt(txtRegGrantScore, 0);
            spread.PlayTimeCount      = CtrlHelper.GetInt(txtPlayTimeCount, 0);
            spread.PlayTimeGrantScore = CtrlHelper.GetInt(txtPlayTimeGrantScore, 0);
            spread.FillGrantRate      = ( decimal )(FillGrantRate / 100);
            spread.BalanceRate        = ( decimal )(BalanceRate / 100);
            spread.MinBalanceScore    = CtrlHelper.GetInt(txtMinBalanceScore, 0);

            try
            {
                FacadeManage.aideTreasureFacade.UpdateGlobalSpreadInfo(spread);
                ShowInfo("更新成功");
            }
            catch
            {
                ShowError("更新失败");
            }
        }
        /// <summary>
        /// 获取推广配置信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public GlobalSpreadInfo GetGlobalSpreadInfo(int id)
        {
            string           sqlQuery = string.Format("(NOLOCK) WHERE ID= {0}", id);
            GlobalSpreadInfo spread   = aideGlobalSpreadInfoProvider.GetObject <GlobalSpreadInfo>(sqlQuery);

            return(spread);
        }
Example #4
0
        protected void DatasBind( )
        {
            GlobalSpreadInfo model = new GlobalSpreadInfo( );

            model = aideTreasureFacade.GetGlobalSpreadInfo( );
            if (model != null)
            {
                gameTime     = model.PlayTimeCount / 60;
                presentGold  = model.PlayTimeGrantScore;
                balanceRate  = model.BalanceRate;
                registerGold = model.RegisterGrantScore;
            }
        }
Example #5
0
        private void BindData( )
        {
            GlobalSpreadInfo spreadinfo = FacadeManage.aideTreasureFacade.GetGlobalSpreadInfo(1);

            if (spreadinfo == null)
            {
                return;
            }
            CtrlHelper.SetText(txtRegGrantScore, spreadinfo.RegisterGrantScore.ToString( ));
            CtrlHelper.SetText(txtPlayTimeCount, spreadinfo.PlayTimeCount.ToString( ));
            CtrlHelper.SetText(txtPlayTimeGrantScore, spreadinfo.PlayTimeGrantScore.ToString( ));
            CtrlHelper.SetText(txtFillGrantRate, (Convert.ToInt32(spreadinfo.FillGrantRate * 100)).ToString( ));
            CtrlHelper.SetText(txtBalanceRate, (Convert.ToInt32(spreadinfo.BalanceRate * 100)).ToString( ));
            CtrlHelper.SetText(txtMinBalanceScore, spreadinfo.MinBalanceScore.ToString( ));
        }
        /// <summary>
        /// 更新推广配置信息
        /// </summary>
        /// <param name="spreadinfo"></param>
        public void UpdateGlobalSpreadInfo(GlobalSpreadInfo spreadinfo)
        {
            StringBuilder sqlQuery = new StringBuilder( );

            sqlQuery.Append("UPDATE GlobalSpreadInfo SET ")
            .Append("RegisterGrantScore=@RegisterGrantScore ,")
            .Append("PlayTimeCount=@PlayTimeCount,")
            .Append("PlayTimeGrantScore=@PlayTimeGrantScore,")
            .Append("FillGrantRate=@FillGrantRate,")
            .Append("BalanceRate=@BalanceRate,")
            .Append("MinBalanceScore=@MinBalanceScore ")
            .Append("WHERE ID= @ID");
            var prams = new List <DbParameter>( );

            prams.Add(Database.MakeInParam("ID", spreadinfo.ID));
            prams.Add(Database.MakeInParam("RegisterGrantScore", spreadinfo.RegisterGrantScore));
            prams.Add(Database.MakeInParam("PlayTimeCount", spreadinfo.PlayTimeCount));
            prams.Add(Database.MakeInParam("PlayTimeGrantScore", spreadinfo.PlayTimeGrantScore));
            prams.Add(Database.MakeInParam("FillGrantRate", spreadinfo.FillGrantRate));
            prams.Add(Database.MakeInParam("BalanceRate", spreadinfo.BalanceRate));
            prams.Add(Database.MakeInParam("MinBalanceScore", spreadinfo.MinBalanceScore));

            Database.ExecuteNonQuery(CommandType.Text, sqlQuery.ToString( ), prams.ToArray( ));
        }
 public void UpdatePromoterSet(GlobalSpreadInfo spreadinfo)
 {
     this.aideTreasureData.UpdatePromoterSet(spreadinfo);
 }
 public void UpdateGlobalSpreadInfo(GlobalSpreadInfo spreadinfo)
 {
     this.aideTreasureData.UpdateGlobalSpreadInfo(spreadinfo);
 }