private void GameTypeItemDataBind()
        {
            if (StrCmd == "add")
            {
                litInfo.Text      = "新增";
                txtTypeID.Enabled = true;
            }
            else
            {
                litInfo.Text      = "更新";
                txtTypeID.Enabled = false;
            }

            if (IntParam <= 0)
            {
                return;
            }

            //获取类型信息
            GamePropertyType gamePropertyType = FacadeManage.aidePlatformFacade.GetGamePropertyTypeInfo(IntParam);

            if (gamePropertyType == null)
            {
                ShowError("类型信息不存在");
                Redirect("GamePropertyTypeList.aspx");
                return;
            }

            CtrlHelper.SetText(txtTypeID, gamePropertyType.TypeID.ToString().Trim());
            CtrlHelper.SetText(txtTypeName, gamePropertyType.TypeName.Trim());
            CtrlHelper.SetText(txtSortID, gamePropertyType.SortID.ToString().Trim());
            rbtnNullity.SelectedValue = gamePropertyType.Nullity.ToString().Trim();
            hdfTagID.Value            = gamePropertyType.TagID.ToString();
            CtrlHelper.SetText(lblTagName, gamePropertyType.TagID == 0 ? "大厅" : "手机");
        }
        private void ProcessData()
        {
            string typeID = CtrlHelper.GetText(txtTypeID);
            string sortID = CtrlHelper.GetText(txtSortID);

            if (!Utils.Validate.IsPositiveInt(typeID))
            {
                ShowError("类型标识不规范,类型标识只能为正整数");
                return;
            }
            if (!Utils.Validate.IsPositiveInt(sortID))
            {
                ShowError("排序输入不规范,排序只能为0或正整数");
                return;
            }
            GamePropertyType gamePropertyType = new GamePropertyType();

            gamePropertyType.TypeID   = Convert.ToInt32(typeID);
            gamePropertyType.TypeName = CtrlHelper.GetText(txtTypeName);
            gamePropertyType.SortID   = CtrlHelper.GetInt(txtSortID, 0);
            gamePropertyType.Nullity  = Convert.ToByte(rbtnNullity.SelectedValue.Trim());
            gamePropertyType.TagID    = Convert.ToInt32(hdfTagID.Value);

            Message msg = new Message();

            if (StrCmd == "add")
            {
                //判断权限
                AuthUserOperationPermission(Permission.Add);
                if (FacadeManage.aidePlatformFacade.IsExistsTypeID(gamePropertyType.TypeID))
                {
                    ShowError("游戏类型标识已经存在");
                    return;
                }
                msg = FacadeManage.aidePlatformFacade.InsertGamePropertyType(gamePropertyType);
            }
            else
            {
                //判断权限
                AuthUserOperationPermission(Permission.Edit);
                msg = FacadeManage.aidePlatformFacade.UpdateGamePropertyType(gamePropertyType);
            }

            if (msg.Success)
            {
                if (StrCmd == "add")
                {
                    ShowInfo("类型信息增加成功", "GamePropertyTypeList.aspx", 1200);
                }
                else
                {
                    ShowInfo("类型信息修改成功", "GamePropertyTypeList.aspx", 1200);
                }
            }
            else
            {
                ShowError(msg.Content);
            }
        }
Exemple #3
0
 public Message UpdateGamePropertyType(GamePropertyType gamePropertyType)
 {
     this.aidePlatformData.UpdateGamePropertyType(gamePropertyType);
     return(new Message(true));
 }
 /// <summary>
 /// 新增道具类型
 /// </summary>
 /// <param name="gamePropertyType"></param>
 public Message InsertGamePropertyType(GamePropertyType gamePropertyType)
 {
     aidePlatformData.InsertGamePropertyType(gamePropertyType);
     return(new Message(true));
 }
Exemple #5
0
        /// <summary>
        /// 获取道具类型
        /// </summary>
        public string GetTypeName(int typeID)
        {
            GamePropertyType type = FacadeManage.aidePlatformFacade.GetGamePropertyTypeInfo(typeID);

            return(type != null ? type.TypeName : "无");
        }