Ejemplo n.º 1
0
        /// <summary>
        /// 更新自定义页
        /// </summary>
        /// <param name="gamePageItem"></param>
        public void UpdateGamePageItem(GamePageItem gamePageItem)
        {
            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("UPDATE GamePageItem SET ")
            .Append("NodeID=@NodeID, ")
            .Append("KindID=@KindID, ")
            .Append("SortID=@SortID, ")
            .Append("OperateType=@OperateType, ")
            .Append("DisplayName=@DisplayName, ")
            .Append("ResponseUrl=@ResponseUrl, ")
            .Append("Nullity=@Nullity ")
            .Append("WHERE PageID=@PageID");

            var prams = new List <DbParameter>();

            prams.Add(Database.MakeInParam("PageID", gamePageItem.PageID));
            prams.Add(Database.MakeInParam("NodeID", gamePageItem.NodeID));
            prams.Add(Database.MakeInParam("KindID", gamePageItem.KindID));
            prams.Add(Database.MakeInParam("SortID", gamePageItem.SortID));
            prams.Add(Database.MakeInParam("OperateType", gamePageItem.OperateType));
            prams.Add(Database.MakeInParam("DisplayName", gamePageItem.DisplayName));
            prams.Add(Database.MakeInParam("ResponseUrl", gamePageItem.ResponseUrl));
            prams.Add(Database.MakeInParam("Nullity", gamePageItem.Nullity));

            Database.ExecuteNonQuery(CommandType.Text, sqlQuery.ToString(), prams.ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取自定义页实体
        /// </summary>
        /// <param name="pageID"></param>
        /// <returns></returns>
        public GamePageItem GetGamePageItemInfo(int pageID)
        {
            string       sqlQuery     = string.Format("(NOLOCK) WHERE PageID= {0}", pageID);
            GamePageItem gamePageItem = aideGamePageItemProvider.GetObject <GamePageItem>(sqlQuery);

            return(gamePageItem);
        }
Ejemplo n.º 3
0
        public bool IsExistsPageID(int pageID)
        {
            GamePageItem gamePageItemInfo = GetGamePageItemInfo(pageID);

            if (gamePageItemInfo == null)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 判断页面是否存在,true-存在,false-不存在
        /// </summary>
        /// <param name="pageID"></param>
        /// <returns></returns>
        public bool IsExistsPageID(int pageID)
        {
            GamePageItem item = GetGamePageItemInfo(pageID);

            if (item == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增自定义页
        /// </summary>
        /// <param name="gamePageItem"></param>
        public void InsertGamePageItem(GamePageItem gamePageItem)
        {
            DataRow dr = aideGamePageItemProvider.NewRow();

            dr[GamePageItem._PageID]      = gamePageItem.PageID;
            dr[GamePageItem._NodeID]      = gamePageItem.NodeID;
            dr[GamePageItem._KindID]      = gamePageItem.KindID;
            dr[GamePageItem._SortID]      = gamePageItem.SortID;
            dr[GamePageItem._OperateType] = gamePageItem.OperateType;
            dr[GamePageItem._DisplayName] = gamePageItem.DisplayName;
            dr[GamePageItem._ResponseUrl] = gamePageItem.ResponseUrl;
            dr[GamePageItem._Nullity]     = gamePageItem.Nullity;

            aideGamePageItemProvider.Insert(dr);
        }
Ejemplo n.º 6
0
        private void BindData( )
        {
            if (StrCmd == "add")
            {
                litInfo.Text      = "新增";
                txtPageID.Enabled = true;
            }
            else
            {
                litInfo.Text      = "更新";
                txtPageID.Enabled = false;
            }

            if (IntParam <= 0)
            {
                return;
            }

            //获取信息
            GamePageItem gamePageItem = FacadeManage.aidePlatformFacade.GetGamePageItemInfo(IntParam);

            if (gamePageItem == null)
            {
                ShowError("页面信息不存在");
                Redirect("GamePageItemList.aspx");
                return;
            }

            CtrlHelper.SetText(txtPageID, gamePageItem.PageID.ToString( ).Trim( ));
            CtrlHelper.SetText(txtPageName, gamePageItem.DisplayName.Trim( ));
            ddlGameKind.SelectedValue    = gamePageItem.KindID.ToString( ).Trim( );
            ddlNode.SelectedValue        = gamePageItem.NodeID.ToString( ).Trim( );
            ddlOperateType.SelectedValue = gamePageItem.OperateType.ToString( ).Trim( );
            CtrlHelper.SetText(txtSortID, gamePageItem.SortID.ToString( ).Trim( ));
            CtrlHelper.SetText(txtResponseUrl, gamePageItem.ResponseUrl.ToString( ).Trim( ));
            rbtnNullity.SelectedValue = gamePageItem.Nullity.ToString( ).Trim( );
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 更新自定义页
 /// </summary>
 /// <param name="gamePageItem"></param>
 public Message UpdateGamePageItem(GamePageItem gamePageItem)
 {
     aidePlatformData.UpdateGamePageItem(gamePageItem);
     return(new Message(true));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 新增自定义页
 /// </summary>
 /// <param name="gamePageItem"></param>
 public Message InsertGamePageItem(GamePageItem gamePageItem)
 {
     aidePlatformData.InsertGamePageItem(gamePageItem);
     return(new Message(true));
 }
Ejemplo n.º 9
0
        private void ProcessData( )
        {
            string pageID = CtrlHelper.GetText(txtPageID);
            string sortID = CtrlHelper.GetText(txtSortID);

            if (!Utils.Validate.IsPositiveInt(pageID))
            {
                ShowError("页面标识不规范,页面标识只能为正整数");
                return;
            }
            if (!Utils.Validate.IsPositiveInt(sortID))
            {
                ShowError("排序不规范,排序只能为0或正整数");
                return;
            }
            GamePageItem gamePageItem = new GamePageItem( );

            gamePageItem.PageID      = Convert.ToInt32(pageID);
            gamePageItem.DisplayName = CtrlHelper.GetText(txtPageName);
            gamePageItem.KindID      = int.Parse(ddlGameKind.SelectedValue);
            gamePageItem.NodeID      = int.Parse(ddlNode.SelectedValue);
            gamePageItem.OperateType = int.Parse(ddlOperateType.SelectedValue);
            gamePageItem.SortID      = Convert.ToInt32(sortID);
            gamePageItem.ResponseUrl = CtrlHelper.GetText(txtResponseUrl);
            gamePageItem.Nullity     = Convert.ToByte(rbtnNullity.SelectedValue.Trim( ));

            Message msg = new Message( );

            if (StrCmd == "add")
            {
                //判断权限
                AuthUserOperationPermission(Permission.Add);
                if (FacadeManage.aidePlatformFacade.IsExistsPageID(gamePageItem.PageID))
                {
                    ShowError("页面标识已经存在");
                    return;
                }
                msg = FacadeManage.aidePlatformFacade.InsertGamePageItem(gamePageItem);
            }
            else
            {
                //判断权限
                AuthUserOperationPermission(Permission.Edit);
                msg = FacadeManage.aidePlatformFacade.UpdateGamePageItem(gamePageItem);
            }

            if (msg.Success)
            {
                if (StrCmd == "add")
                {
                    ShowInfo("页面信息增加成功", "GamePageItemList.aspx", 1200);
                }
                else
                {
                    ShowInfo("页面信息修改成功", "GamePageItemList.aspx", 1200);
                }
            }
            else
            {
                ShowError(msg.Content);
            }
        }