Esempio n. 1
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_OK_Click(object sender, EventArgs e)
        {
            string strInfos = "";

            if (false == VerifyArgumentsBeforeAction(out strInfos))
            {
                MessageBox.Show(strInfos);
                return;
            }

            #region 测试数据
            DelistingRequest requireDelistBrandArgs = new DelistingRequest();
            if (DataManager.Instance.LoginData == null)
            {
                MessageBox.Show("登陆状态有误,请重新登陆");
                return;
            }

            requireDelistBrandArgs.clientId      = DataManager.Instance.LoginData.currentCompany.id + "_pc";
            requireDelistBrandArgs.mqId          = "test";
            requireDelistBrandArgs.commId        = Convert.ToInt64(m_commodityInfo.id);
            requireDelistBrandArgs.operationType = 2;
            requireDelistBrandArgs.basePrice     = m_commodityInfo.fixedPrice; //绝对价格-基价
            requireDelistBrandArgs.commQuantity  = this.comboBox_VolumnChoice.Text;
            requireDelistBrandArgs.cid           = m_commodityInfo.cid;
            requireDelistBrandArgs.remarks       = "我是韩宇在摘牌";

            DelistingResponse response = HttpService.PostDelistBrandOrder(requireDelistBrandArgs);

            if (response != null && response.data != null)
            {
                m_dataResult = response.data;
                MessageBox.Show("摘牌成功!");
                //刷新行情列表
                DataManager.Instance.GetCommodity();
                //招牌成功对外通知
                if (OnDelistSuccessEvent != null)
                {
                    OnDelistSuccessEvent(this, null);
                }
            }
            else
            {
                if (response != null)
                {
                    MessageBox.Show("摘牌失败:" + response.msg);
                }
                else
                {
                    MessageBox.Show("摘牌失败");
                }
                return;
            }

            this.Close();
            #endregion
        }
Esempio n. 2
0
        /// <summary>
        /// 摘牌
        /// </summary>
        public static DelistingResponse PostDelistBrandOrder(DelistingRequest require)
        {
            if (DataManager.Instance.Cookies != null)
            {
                string cookies = DataManager.Instance.Cookies;
                //组装成URL后缀请求
                ////string str = "mqID=" + require.mqId + "&";
                //string str = "clientId=" + require.clientId + "&";
                //str = str + "commId=" + require.commId.ToString() + "&";
                ////str = str + "cid=" + require.cid + "&";
                //str = str + "operationType=" + require.operationType + "&";
                //str = str + "basePrice=" + require.basePrice + "&";
                //str = str + "commQuantity=" + require.commQuantity;// + "&";
                ////str = str + "remarks=" + require.remarks;
                ////string str = "mqID=" + require.mqId + "&";
                //string url = Helper.GetURL(HTTPServiceUrlCollection.PostDelistBrandOrderRequireInfoUrl) + "?" + HttpUtility.UrlEncode(str);
                //string hr = PostData(url, cookies, null, "application/json");

                //string str = "clientId=" + require.clientId + "&";
                //str = str + "commId=" + require.commId.ToString() + "&";
                //str = str + "operationType=" + require.operationType + "&";
                //str = str + "basePrice=" + require.basePrice + "&";
                //str = str + "commQuantity=" + require.commQuantity;

                string str = "{\"clientId\" :\"" + require.clientId + "\",";
                str = str + "\"commId\" :\"" + require.commId.ToString() + "\",";
                str = str + "\"operationType\" :\"" + require.operationType + "\",";
                str = str + "\"basePrice\" :\"" + require.basePrice + "\",";
                str = str + "\"commQuantity\" :\"" + require.commQuantity + "\"}";

                string url = Helper.GetURL(HTTPServiceUrlCollection.PostDelistBrandOrderRequireInfoUrl);
                string hr  = PostData(url, cookies, str, "application/json");

                if (hr != null)
                {
                    try
                    {
                        var bi = Helper.Deserialize <DelistingResponse>(hr);
                        return(bi);
                    }
                    catch (Exception err)
                    {
                        Logger.LogError(err.ToString());
                    }
                }
            }
            return(null);
        }