コード例 #1
0
ファイル: PlatformDataProvider.cs プロジェクト: toowind/QY
        /// <summary>
        /// 获取泡点规则实体
        /// </summary>
        /// <param name="serverID"></param>
        /// <returns></returns>
        public GlobalPlayPresent GetGlobalPlayPresentInfo(int serverID)
        {
            string            sqlQuery          = string.Format("(NOLOCK) WHERE ServerID= {0}", serverID);
            GlobalPlayPresent globalPlayPresent = aideGlobalPlayPresentProvider.GetObject <GlobalPlayPresent>(sqlQuery);

            return(globalPlayPresent);
        }
コード例 #2
0
        private void BindData( )
        {
            if (IntParam == 0)
            {
                phPresent.Visible    = true;
                phMaxPresent.Visible = false;
                return;
            }
            else
            {
                ddlGameRoom.Enabled = false;
            }
            GlobalPlayPresent globalPlayPresent = aidePlatformFacade.GetGlobalPlayPresentInfo(IntParam);

            if (globalPlayPresent == null)
            {
                return;
            }
            if (IntParam == -3)
            {
                CtrlHelper.SetText(txtMaxDatePresent, globalPlayPresent.MaxDatePresent.ToString( ));
                CtrlHelper.SetText(txtMaxPresent, globalPlayPresent.MaxPresent.ToString( ));
                phMaxPresent.Visible = true;
                phPresent.Visible    = false;
                return;
            }
            phPresent.Visible         = true;
            phMaxPresent.Visible      = false;
            ddlGameRoom.SelectedValue = globalPlayPresent.ServerID.ToString( );
            string[]  arrMemberOrder = globalPlayPresent.PresentMember.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            ArrayList list           = new ArrayList(arrMemberOrder);

            foreach (ListItem item in ckbMemberOrder.Items)
            {
                item.Selected = list.Contains(item.Value);
            }

            CtrlHelper.SetText(txtCellPlayPresnet, globalPlayPresent.CellPlayPresnet.ToString( ));
            CtrlHelper.SetText(txtCellPlayTime, globalPlayPresent.CellPlayTime.ToString( ));
            CtrlHelper.SetText(txtStartPlayTime, globalPlayPresent.StartPlayTime.ToString( ));

            CtrlHelper.SetText(txtCellOnlinePresent, globalPlayPresent.CellOnlinePresent.ToString( ));
            CtrlHelper.SetText(txtCellOnlineTime, globalPlayPresent.CellOnlineTime.ToString( ));
            CtrlHelper.SetText(txtStartOnlineTime, globalPlayPresent.StartOnlineTime.ToString( ));
            CtrlHelper.SetText(ltCollectDate, globalPlayPresent.CollectDate.ToString("yyyy-MM-dd HH:mm:ss"));
            ckbIsPlayPresent.Checked   = globalPlayPresent.IsPlayPresent == 1;
            ckbIsOnlinePresent.Checked = globalPlayPresent.IsOnlinePresent == 1;
        }
コード例 #3
0
ファイル: PlatformDataProvider.cs プロジェクト: toowind/QY
        /// <summary>
        ///  更新泡点规则信息
        /// </summary>
        /// <param name="globalPlayPresent"></param>
        public void UpdateGlobalPlayPresent(GlobalPlayPresent globalPlayPresent)
        {
            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("UPDATE GlobalPlayPresent SET ")
            .Append("PresentMember=@PresentMember, ")
            .Append("MaxDatePresent=@MaxDatePresent, ")
            .Append("MaxPresent=@MaxPresent, ")
            .Append("CellPlayPresnet=@CellPlayPresnet, ")

            .Append("CellPlayTime=@CellPlayTime, ")
            .Append("StartPlayTime=@StartPlayTime, ")
            .Append("CellOnlinePresent=@CellOnlinePresent, ")
            .Append("CellOnlineTime=@CellOnlineTime, ")

            .Append("StartOnlineTime=@StartOnlineTime, ")
            .Append("IsPlayPresent=@IsPlayPresent, ")
            .Append("IsOnlinePresent=@IsOnlinePresent, ")
            .Append("CollectDate=@CollectDate ")
            .Append("WHERE ServerID=@ServerID");

            var prams = new List <DbParameter>();

            prams.Add(Database.MakeInParam("PresentMember", globalPlayPresent.PresentMember));
            prams.Add(Database.MakeInParam("MaxDatePresent", globalPlayPresent.MaxDatePresent));
            prams.Add(Database.MakeInParam("MaxPresent", globalPlayPresent.MaxPresent));
            prams.Add(Database.MakeInParam("CellPlayPresnet", globalPlayPresent.CellPlayPresnet));
            prams.Add(Database.MakeInParam("CellPlayTime", globalPlayPresent.CellPlayTime));

            prams.Add(Database.MakeInParam("StartPlayTime", globalPlayPresent.StartPlayTime));
            prams.Add(Database.MakeInParam("CellOnlinePresent", globalPlayPresent.CellOnlinePresent));
            prams.Add(Database.MakeInParam("CellOnlineTime", globalPlayPresent.CellOnlineTime));
            prams.Add(Database.MakeInParam("StartOnlineTime", globalPlayPresent.StartOnlineTime));
            prams.Add(Database.MakeInParam("IsPlayPresent", globalPlayPresent.IsPlayPresent));
            prams.Add(Database.MakeInParam("IsOnlinePresent", globalPlayPresent.IsOnlinePresent));
            prams.Add(Database.MakeInParam("CollectDate", globalPlayPresent.CollectDate));
            prams.Add(Database.MakeInParam("ServerID", globalPlayPresent.ServerID));

            Database.ExecuteNonQuery(CommandType.Text, sqlQuery.ToString(), prams.ToArray());
        }
コード例 #4
0
ファイル: PlatformDataProvider.cs プロジェクト: toowind/QY
        /// <summary>
        /// 新增泡点规则信息
        /// </summary>
        /// <param name="globalPlayPresent"></param>
        public void InsertGlobalPlayPresent(GlobalPlayPresent globalPlayPresent)
        {
            DataRow dr = aideGlobalPlayPresentProvider.NewRow();

            dr[GlobalPlayPresent._ServerID]        = globalPlayPresent.ServerID;
            dr[GlobalPlayPresent._PresentMember]   = globalPlayPresent.PresentMember;
            dr[GlobalPlayPresent._MaxDatePresent]  = globalPlayPresent.MaxDatePresent;
            dr[GlobalPlayPresent._MaxPresent]      = globalPlayPresent.MaxPresent;
            dr[GlobalPlayPresent._CellPlayPresnet] = globalPlayPresent.CellPlayPresnet;
            dr[GlobalPlayPresent._CellPlayTime]    = globalPlayPresent.CellPlayTime;

            dr[GlobalPlayPresent._StartPlayTime]     = globalPlayPresent.StartPlayTime;
            dr[GlobalPlayPresent._CellOnlinePresent] = globalPlayPresent.CellOnlinePresent;
            dr[GlobalPlayPresent._CellOnlineTime]    = globalPlayPresent.CellOnlineTime;
            dr[GlobalPlayPresent._StartOnlineTime]   = globalPlayPresent.StartOnlineTime;

            dr[GlobalPlayPresent._IsPlayPresent]   = globalPlayPresent.IsPlayPresent;
            dr[GlobalPlayPresent._IsOnlinePresent] = globalPlayPresent.IsOnlinePresent;
            dr[GlobalPlayPresent._CollectDate]     = globalPlayPresent.CollectDate;

            aideGlobalPlayPresentProvider.Insert(dr);
        }
コード例 #5
0
 /// <summary>
 ///  更新泡点规则信息
 /// </summary>
 /// <param name="globalPlayPresent"></param>
 public Message UpdateGlobalPlayPresent(GlobalPlayPresent globalPlayPresent)
 {
     aidePlatformData.UpdateGlobalPlayPresent(globalPlayPresent);
     return(new Message(true));
 }
コード例 #6
0
 /// <summary>
 /// 新增泡点规则信息
 /// </summary>
 /// <param name="globalPlayPresent"></param>
 public Message InsertGlobalPlayPresent(GlobalPlayPresent globalPlayPresent)
 {
     aidePlatformData.InsertGlobalPlayPresent(globalPlayPresent);
     return(new Message(true));
 }
コード例 #7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            GlobalPlayPresent present;

            if (IntParam == 0)
            {
                present = new GlobalPlayPresent( );
            }
            else
            {
                present = aidePlatformFacade.GetGlobalPlayPresentInfo(IntParam);
                if (present == null)
                {
                    return;
                }
            }
            if (IntParam == -3)
            {
                present.ServerID = IntParam;
            }
            else
            {
                present.ServerID = int.Parse(ddlGameRoom.SelectedValue.ToString( ));
            }
            StringBuilder sb = new StringBuilder( );

            foreach (ListItem item in ckbMemberOrder.Items)
            {
                if (item.Selected)
                {
                    sb.AppendFormat("{0},", item.Value);
                }
            }
            present.PresentMember     = sb.ToString( ).TrimEnd(new char[] { ',' });
            present.MaxPresent        = CtrlHelper.GetInt(txtMaxPresent, 0);
            present.MaxDatePresent    = CtrlHelper.GetInt(txtMaxDatePresent, 0);
            present.CellPlayPresnet   = CtrlHelper.GetInt(txtCellPlayPresnet, 0);
            present.CellPlayTime      = CtrlHelper.GetInt(txtCellPlayTime, 0);
            present.StartPlayTime     = CtrlHelper.GetInt(txtStartPlayTime, 0);
            present.CellOnlinePresent = CtrlHelper.GetInt(txtCellOnlinePresent, 0);
            present.CellOnlineTime    = CtrlHelper.GetInt(txtCellOnlineTime, 0);
            present.StartOnlineTime   = CtrlHelper.GetInt(txtStartOnlineTime, 0);
            present.IsPlayPresent     = ( byte )(ckbIsPlayPresent.Checked ? 1 : 0);
            present.IsOnlinePresent   = ( byte )(ckbIsOnlinePresent.Checked ? 1 : 0);
            present.CollectDate       = DateTime.Now;
            if (IntParam == 0)
            {
                //判断权限
                AuthUserOperationPermission(Permission.Add);
                if (aidePlatformFacade.GetGlobalPlayPresentInfo(present.ServerID) != null)
                {
                    ShowError("该房间的泡点设置已存在");
                    return;
                }
                aidePlatformFacade.InsertGlobalPlayPresent(present);
                ShowInfo("新增成功");
            }
            else
            {
                //判断权限
                AuthUserOperationPermission(Permission.Edit);
                if (aidePlatformFacade.GetGlobalPlayPresentInfo(present.ServerID) != null && IntParam != present.ServerID)
                {
                    ShowError("该房间的泡点设置已存在");
                    return;
                }
                aidePlatformFacade.UpdateGlobalPlayPresent(present);
                ShowInfo("更新成功");
            }
        }