Esempio n. 1
0
        //添加库存信息
        protected void stock_insert()
        {
            int    _retVal;
            String _uid          = Session["userid"].ToString();
            String _serverId     = ddl_serverlist.SelectedValue;
            String _stockAmount  = tb_stock_amount.Text;
            String _presellPrice = tb_presell_price.Text;

            span_profile_tips.Attributes["style"] = "";

            if ((ddl_gamelist.SelectedValue == "0") || (ddl_gamelist.SelectedValue == null) || (ddl_serverlist.SelectedValue == "0") || (ddl_serverlist.SelectedValue == null))
            {
                _retVal = -1;
            }
            else
            {
                if ((_stockAmount.Length < 1) || (_presellPrice.Length < 1))
                {
                    _retVal = -2;
                }
                else
                {
                    _retVal = _stockLogic.StockInsert(_uid, _serverId, _stockAmount, _presellPrice);
                }
            }

            switch (_retVal)
            {
            case 2: span_profile_tips.InnerHtml = "游戏未开仓!"; break;

            case 3: span_profile_tips.InnerHtml = "该服务器库存记录已存在!"; break;

            case 4: span_profile_tips.InnerHtml = "添加成功!"; tr_querynull.Visible = false; stock_query(); break;

            case -1: span_profile_tips.InnerHtml = "请选择游戏和服务器!"; break;

            case -2: span_profile_tips.InnerHtml = "请填写可供货量和预售价格!"; break;

            default: span_profile_tips.InnerHtml = "添加失败,请稍后再试!"; break;
            }
        }