Esempio n. 1
0
        /// <summary>
        /// 查询自己的挂牌列表
        /// </summary>
        public void InitializePutBrandList(ContractCategoryDic contractVo)
        {
            Debug.Assert(contractVo != null && contractVo.id != "");

            m_commodityInfoList.Clear();
            var selfListedList = HttpService.GetSelfListedList(contractVo.id);

            if (selfListedList != null)
            {
                try
                {
                    foreach (SelfListed info in selfListedList)
                    {
                        if (info.pricingMethod == "0" && info.premium != null)
                        {
                            var vvv = DataManager.Instance.GetContractLastPrice(info.contract);
                            if (vvv != null)
                            {
                                int premium;
                                int.TryParse(info.premium, out premium);
                                if (premium != 0)
                                {
                                    if (info.transType == "0")
                                    {
                                        info.fixedPrice = (vvv.bidPrice + premium).ToString();
                                    }
                                    else
                                    {
                                        info.fixedPrice = (vvv.askPrice + premium).ToString();
                                    }
                                }
                            }
                        }
                        m_commodityInfoList.Add(info);
                    }
                }
                catch (Exception err)
                {
                    MessageBox.Show("获取挂牌列表发生异常请重试");
                    Logger.LogError(err.ToString());
                }
            }
            dataGridView_PutBrand.ClearSelection();
        }