コード例 #1
0
ファイル: UseListed.cs プロジェクト: handayu/TFS-WebKit
        public string outId;                   //外部系统数据ID

        public void Update(OneListed obj)
        {
            seqNum                  = obj.seqNum;                  //返回信息
            transType               = obj.transType;               //卖和买。 0:采购 1:销售
            transTypeName           = obj.transTypeName;           //卖和买名称
            transStatus             = obj.transStatus;             //状态。 1:挂牌 2:摘牌 3:锁定 4:下架
            transStatusName         = obj.transStatusName;         //状态名称
            cid                     = obj.cid;                     //品类ID
            commBrandId             = obj.commBrandId;             //商品品牌ID
            commLevel               = obj.commLevel;               //商品等级ID
            commLevelName           = obj.commLevelName;           //商品品牌
            premium                 = obj.premium;                 //升贴水
            commTotalQuantity       = obj.commTotalQuantity;       //   数量
            commAvailableQuantity   = obj.commAvailableQuantity;   //可用数量
            minDealQuantity         = obj.minDealQuantity;         //最小成交数
            commTotalProportion     = obj.commTotalProportion;     //总保证金
            commAvailableProportion = obj.commAvailableProportion; //可用保证金
            warehouseId             = obj.warehouseId;             //仓库ID
            warehouseName           = obj.warehouseName;           //仓库名称
            publisher               = obj.publisher;               //发布公司(公司名称)
            publisherId             = obj.publisherId;             //发布公司ID(公司ID)
            remarks                 = obj.remarks;                 //备注
            publisherDate           = obj.publisherDate;           //发布时间
            createdBy               = obj.createdBy;               //创建人(用户ID)
            blackWhiteType          = obj.blackWhiteType;          //黑白名单 0:黑名单 1:白名单
            oneself                 = obj.oneself;                 //自己:true 他人:false
            pricingMethod           = obj.pricingMethod;           //定价方式:0 点价 1 一口价
            fixedPrice              = obj.fixedPrice;              //固定价格
            ensureMethod            = obj.ensureMethod;            //保证方式 0:保证金 1:实货凭证
            contract                = obj.contract;                //参考合约,例:1709
            warehouseReceiptNum     = obj.warehouseReceiptNum;     //仓单号
            outSource               = obj.outSource;
            outId                   = obj.outId;
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: handayu/TFS-WebKit
 /// <summary>
 /// MQTT更新挂牌列表
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="type"></param>
 private void Instance_UpdataCommodityInfoEvent(OneListed obj, int type)
 {
     if (table != null)
     {
         table.UpdateCommodity(obj, type);
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 更新挂牌列表
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="type"></param>
        private void Instance_UpdataCommodityInfoEvent(OneListed obj, int type)
        {
            var current = DataManager.Instance.CurrentCategory;

            if (obj != null && current != null && current.id == obj.cid)
            {
                //新增
                if (type == 0)
                {
                    //买
                    table.InsertData(obj, 0);
                    this.BeginInvoke((MethodInvoker) delegate { this.Draw(); });
                }
                else if (type == 1)
                {
                    //卖
                    table.InsertData(obj, 1);
                    this.BeginInvoke((MethodInvoker) delegate { this.Draw(); });
                }
                else if (type == 2)
                {
                    //更新
                    table.Updata(obj);
                    this.BeginInvoke((MethodInvoker) delegate { this.Draw(); });
                }
            }
        }
コード例 #4
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
 void radGridView1_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.ColumnIndex < dataSource1.Columns)
     {
         OneListed info = this.dataSource1.Source[e.RowIndex];
         SetData(e, info);
     }
 }
コード例 #5
0
        /// <summary>
        /// 查询指定CmmBrandID的CombrandName
        /// </summary>
        public static string QueryHttpBrandName(OneListed info)
        {
            if (info == null || info.commBrandId == "" || info.cid == "")
            {
                return("");
            }
            LevelBrandResponse levelBrandInfo = new LevelBrandResponse();

            try
            {
                string cookies = DataManager.Instance.Cookies;
                string url     = Helper.GetURL(HTTPServiceUrlCollection.GetBaseLevelBrandInfoUrl) + "cid=" + info.cid;
                string hr      = GetData(url, cookies);
                if (hr != null)
                {
                    try
                    {
                        levelBrandInfo = Helper.Deserialize <LevelBrandResponse>(hr);
                    }
                    catch (Exception err)
                    {
                        Logger.LogError(err.ToString());
                    }
                }

                if (levelBrandInfo.Result == null)
                {
                    return("");
                }
                foreach (LevelBrandList infos in levelBrandInfo.Result)
                {
                    if (infos.infoName != info.commLevelName)
                    {
                        continue;
                    }
                    if (infos.infoList == null || infos.infoList.Count < 0)
                    {
                        continue;
                    }
                    List <LevelBrand> infoList = infos.infoList;
                    foreach (LevelBrand it in infoList)
                    {
                        if (it.id.ToString() != info.commBrandId)
                        {
                            continue;
                        }
                        return(it.infoName);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogError("摘牌品牌名称获取异常:" + ex.Message);
            }

            return("");
        }
コード例 #6
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
 void radGridView2_CellValueNeeded(object sender, GridViewCellValueEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.ColumnIndex < dataSource2.Columns)
     {
         OneListed info = this.dataSource2.Source[e.RowIndex];
         SetData(e, info);
         //Type type = one.GetType(); //获取类型
         //System.Reflection.PropertyInfo propertyInfo = type.GetProperty(e.Column.Name); //获取指定名称的属性
         //e.Value = propertyInfo.GetValue(one, null); //获取属性
     }
 }
コード例 #7
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
 public void Updata(string category, float buyPrice, float sellPrice)
 {
     if (sellPrice != 0 && dataSource1 != null)
     {
         bool flag = false;
         for (int i = 0; i < dataSource1.Rows; i++)
         {
             OneListed ci = this.dataSource1.Source[i];
             if (ci != null)
             {
                 if (ci.pricingMethod == "0" && ci.premium != null && ci.contract != null && category.EndsWith(ci.contract))
                 {
                     int premium;
                     int.TryParse(ci.premium, out premium);
                     if (premium != 0)
                     {
                         ci.fixedPrice = (sellPrice + premium).ToString();
                         flag          = true;
                     }
                 }
             }
         }
         if (flag)
         {
             this.radGridView1.MasterTemplate.Refresh();
         }
     }
     if (buyPrice != 0 && dataSource2 != null)
     {
         bool flag = false;
         for (int i = 0; i < dataSource2.Rows; i++)
         {
             OneListed ci = this.dataSource2.Source[i];
             if (ci != null)
             {
                 if (ci.pricingMethod == "0" && ci.premium != null && ci.contract != null && category.EndsWith(ci.contract))
                 {
                     int premium;
                     int.TryParse(ci.premium, out premium);
                     if (premium != 0)
                     {
                         ci.fixedPrice = (buyPrice + premium).ToString();
                         flag          = true;
                     }
                 }
             }
         }
         if (flag)
         {
             this.radGridView2.MasterTemplate.Refresh();
         }
     }
 }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 鼠标右击仓库详细信息事件
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="p"></param>
        private void Table_MouseRightUpEvent(object obj, Point p)
        {
            if (obj == null)
            {
                return;
            }
            OneListed ci = obj as OneListed;

            if (ci == null)
            {
                return;
            }
            m_form.Location = p;
            m_form.SetCommodityInfo(ci);
            m_form.ShowDialog();
        }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        ///  鼠标左击指定行事件
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="p"></param>
        private void Table_MouseLeftUpEvent(object obj, Point p)
        {
            if (obj == null)
            {
                return;
            }
            OneListed ci = obj as OneListed;

            if (ci == null)
            {
                return;
            }
            string url = Helper.GetURL(HTTPServiceUrlCollection.GetWareHouseInfoUrl, ci.warehouseId);

            fh.SetHouse(url);
            fh.Show();
        }
コード例 #10
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
        public void UpdateCommodity(OneListed obj, int type)
        {
            if (dataSource1 == null && dataSource2 == null)
            {
                return;
            }
            var current = DataManager.Instance.CurrentCategory;

            if (obj != null && current != null && current.id == obj.cid)
            {
                //新增
                if (type == 0)
                {
                    //买
                    dataSource2.AddData(obj);
                    this.radGridView2.RowCount = this.dataSource2.Rows;
                    this.radGridView2.MasterTemplate.Refresh();
                }
                else if (type == 1)
                {
                    //卖
                    dataSource1.AddData(obj);
                    this.radGridView1.RowCount = this.dataSource1.Rows;
                    this.radGridView1.MasterTemplate.Refresh();
                }
                else if (type == 2)
                {
                    //更新
                    if (dataSource1.Update(obj))
                    {
                        this.radGridView1.MasterTemplate.Refresh();
                    }
                    else if (dataSource2.Update(obj))
                    {
                        this.radGridView2.MasterTemplate.Refresh();
                    }
                }
                AdjustmentGrid();
            }
        }
コード例 #11
0
ファイル: MUseMainForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 鼠标右击摘牌事件
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="p"></param>
        private void Table_MouseRightUpEvent(object obj, Point p)
        {
            //根据登陆之后获取到的账户类型判断,无论是什么账户,只要是非商城订单都可以摘牌
            if (obj == null)
            {
                return;
            }
            OneListed ci = obj as OneListed;

            if (ci == null)
            {
                return;
            }
            //非商城订单
            if (ci.outId == null || ci.outId == "")
            {
                m_form.Location = p;
                m_form.SetCommodityInfo(ci);
                m_form.ShowDialog();
            }
            else
            {
                //商城订单-》1 判断账户ssouser 2 商城订单--》跳转URL
                if (DataManager.Instance.LoginData.isSsoUser == "True")
                {
                    //跳转http://183.6.168.58:6620/main.html
                    string getUrl = Helper.GetURL(HTTPServiceUrlCollection.GetOsserUserURL);
                    System.Diagnostics.Process.Start(getUrl);
                }

                //商城订单-》1 判断账户upricingUser 2 商城订单--》跳转URL
                if (DataManager.Instance.LoginData.isUpricingUser == "True")
                {
                    //跳转http://183.6.168.58:6620/openapi/user/jump?type=product_mall_detail&user_access_token={token}&id={outId}
                    string getURL = string.Format(Helper.GetURL(HTTPServiceUrlCollection.GetUpricingUserURl),
                                                  DataManager.Instance.Cookies, ci.id);
                    System.Diagnostics.Process.Start(getURL);
                }
            }
        }
コード例 #12
0
ファイル: UseListed.cs プロジェクト: handayu/TFS-WebKit
        public static OneListed CreateModelCommmodiInfo(OneListed info)
        {
            OneListed infoModel = new OneListed();

            infoModel.Id                      = info.Id;
            infoModel.SeqNum                  = info.SeqNum;
            infoModel.transType               = info.transType;
            infoModel.transTypeName           = info.transTypeName;
            infoModel.transStatus             = info.transStatus;
            infoModel.transStatusName         = info.transStatusName;
            infoModel.Cid                     = info.Cid;
            infoModel.CommBrandId             = info.CommBrandId;
            infoModel.CommLevel               = info.CommLevel;
            infoModel.CommLevelName           = info.CommLevelName;
            infoModel.Premium                 = info.Premium;
            infoModel.CommTotalQuantity       = info.CommTotalQuantity;
            infoModel.CommAvailableQuantity   = info.CommAvailableQuantity;
            infoModel.MinDealQuantity         = info.MinDealQuantity;
            infoModel.CommTotalProportion     = info.CommTotalProportion;
            infoModel.CommAvailableProportion = info.CommAvailableProportion;
            infoModel.WarehouseId             = info.WarehouseId;
            infoModel.WarehouseName           = info.WarehouseName;
            infoModel.Publisher               = info.Publisher;
            infoModel.PublisherId             = info.PublisherId;
            infoModel.Remarks                 = info.Remarks;
            infoModel.PublisherDate           = info.PublisherDate;
            infoModel.CreatedBy               = info.CreatedBy;
            infoModel.BlackWhiteType          = info.BlackWhiteType;
            infoModel.Oneself                 = info.Oneself;
            infoModel.PricingMethod           = info.PricingMethod;
            infoModel.FixedPrice              = info.FixedPrice;
            infoModel.EnsureMethod            = info.EnsureMethod;
            infoModel.Contract                = info.Contract;
            infoModel.WarehouseReceiptNum     = info.WarehouseReceiptNum;
            infoModel.outSource               = info.outSource;
            infoModel.outId                   = info.outId;

            return(infoModel);
        }
コード例 #13
0
        private void MQTTService_UpdataEvent(string obj)
        {
            if (obj != null)
            {
                if (obj == "getBaseInfo")
                {
                    //刷新
                    GetContract();
                    return;
                }

                //挂牌信息
                var b1 = Helper.Deserialize <OneListedResponse>(obj);

                if (b1.Success && b1.Result != null && CommodityDataDy != null)
                {
                    int       type = 2;
                    OneListed cd   = b1.Result;
                    if (cd != null && !HttpService.JudgmentBlack(cd.PublisherId))
                    {
                        if (cd.id != null)
                        {
                            if (CommodityDataDy.ContainsKey(cd.id))
                            {
                                //更新
                                CommodityDataDy[cd.id].Update(cd);
                                type = 2;//更新
                            }
                            else
                            {
                                type = cd.transType;
                                CommodityDataDy.Add(cd.id, cd);
                            }
                            UpdataCommodityInfoEvent?.Invoke(cd, type);
                        }
                    }
                    return;
                }

                //if (b1.Result.TransStatusName == "摘牌")
                //{
                //    //摘牌
                //    var b2 = Helper.Deserialize<DelistBrandOrderResponseArguments>(obj);
                //    if (b2.data != null)
                //    {
                //        UpdataDelistingEvent?.Invoke(b2.data);
                //        return;
                //    }
                //}
                ////核销
                //var b3 = Helper.Deserialize<DelistBrandVerifyResponseArguments>(obj);
                //if (b3.Success && b3.data != null)
                //{
                //    NoticeWriteOffEvent?.Invoke(b3.data);
                //}
                ////撤牌
                //var b4 = Helper.Deserialize<ActionOrderResponseArguments>(obj);
                //if (b4.Success && b4.result != null)
                //{
                //    NoticeWithdrawTheCard?.Invoke(b4.result);
                //}
                UpdataEvent?.Invoke(obj);
            }
        }
コード例 #14
0
ファイル: MUseMainForm2.cs プロジェクト: handayu/TFS-WebKit
        private void SetData(GridViewCellValueEventArgs e, OneListed info)
        {
            switch (e.ColumnIndex)
            {
            case 0:
            {
                if (DataManager.Instance.LoginData != null)
                {
                    if (info.createdBy == DataManager.Instance.LoginData.id)
                    {
                        e.Value = mPaint.MCommonData.Publish;
                    }
                    else if (DataManager.Instance.WhiteEnable && DataManager.Instance.WhiteDY != null && info.publisher != null && DataManager.Instance.WhiteDY.ContainsKey(info.publisher))
                    {
                        e.Value = mPaint.MCommonData.White;
                    }
                    else if (DataManager.Instance.BlackEnable && DataManager.Instance.BlackDY != null && info.publisher != null && DataManager.Instance.BlackDY.ContainsKey(info.publisher))
                    {
                        e.Value = mPaint.MCommonData.Black;
                    }
                    else
                    {
                        e.Value = null;
                    }
                }
            }
            break;

            case 1: e.Value = info.transTypeName; break;

            case 2: e.Value = info.commLevelName; break;

            case 3:
            {
                if (string.IsNullOrWhiteSpace(info.contract))
                {
                    e.Value = "--";
                }
                else
                {
                    e.Value = info.contract;
                }
            }
            break;

            case 4:
            {
                if (string.IsNullOrWhiteSpace(info.premium))
                {
                    e.Value = "--";
                }
                else
                {
                    e.Value = info.premium;
                }
            }
            break;

            case 5:
            {
                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();
                            }
                        }
                    }
                }
                decimal money;
                decimal.TryParse(info.fixedPrice, out money);
                if (money > 0)
                {
                    e.Value = string.Format("{0:C}", money);
                }
                else
                {
                    e.Value = "";
                }
            }
            break;

            case 6: e.Value = info.commAvailableQuantity; break;

            case 7:
            {
                string text = info.warehouseName;
                if (text != null && text.Length >= 6)
                {
                    text = text.Substring(0, 6) + "...";
                }
                e.Value = text;
            }
            break;

            case 8: e.Value = info.publisher; break;

            case 9: e.Value = info.remarks; break;

            case 10:
            {
                long l;
                long.TryParse(info.publisherDate, out l);
                e.Value = start.AddMilliseconds(l).ToLocalTime().ToString("HH:mm:ss");
            }
            break;

            default: break;
            }
        }
コード例 #15
0
ファイル: DelistBrandForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 挂牌行情表调用,获取参数,准备摘牌操作
        /// </summary>
        /// <param name="commodityInfo"></param>
        public void SetDefultFieldToDelistBrand(OneListed commodityInfo)
        {
            if (commodityInfo == null)
            {
                MessageBox.Show("摘牌参数不能为空");
                return;
            }

            m_commodityInfo = commodityInfo;

            CreditQuotaRequest args = new CreditQuotaRequest()
            {
                compId = commodityInfo.publisherId,
            };


            decimal canUseAvaliableMoney = 0m;
            //信用额度
            CreditQuotaResponse avaliableQuatityArgs = HttpService.GetDelistAditQuatity(args);

            if (avaliableQuatityArgs != null && avaliableQuatityArgs.data != null && avaliableQuatityArgs.data.creditLineAmt != null &&
                avaliableQuatityArgs.data.creditLineAmt != "")
            {
                canUseAvaliableMoney = Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt);
                this.label_AvaliableCridetCash.Text = string.Format("{0:C}", (Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt)));
            }
            else
            {
                canUseAvaliableMoney = 0m;
                this.label_AvaliableCridetCash.Text = string.Format("{0:C}", 0m);
            }

            //品牌-中文显示(原来是ID,现在切换为Name)
            this.label_Brand.Text = HttpService.QueryHttpBrandName(commodityInfo);

            //升贴水
            if (commodityInfo.premium == null)
            {
                this.label_UpDownPrice.Text = "---";
            }
            else
            {
                this.label_UpDownPrice.Text = commodityInfo.premium;
            }
            //else if (Convert.ToDecimal(commodityInfo.premium) > 0m)
            //{
            //    this.label_UpDownPrice.Text = "+" + commodityInfo.premium;
            //}
            //else
            //{
            //    this.label_UpDownPrice.Text = "-" + commodityInfo.premium;
            //}

            //成交量
            this.comboBox_VolumnChoice.Items.Clear();
            this.comboBox_VolumnChoice.Text = "";

            int min;

            int.TryParse(commodityInfo.minDealQuantity, out min);
            int all;

            int.TryParse(commodityInfo.commAvailableQuantity, out all);
            for (int i = min; i < all; i += min)
            {
                this.comboBox_VolumnChoice.Items.Add(i.ToString());
            }
            this.comboBox_VolumnChoice.Items.Add(all.ToString());
            if (comboBox_VolumnChoice.Items.Count > 0)
            {
                comboBox_VolumnChoice.SelectedIndex = 0;
            }

            //查询结算价
            Dictionary <string, ContractCategoryDic> vo = DataManager.Instance.GetContractcCategoryVo();

            if (vo == null || vo.Values.Count <= 0)
            {
                this.label_StandPrice.Text = "---";
            }
            else
            {
                foreach (KeyValuePair <string, ContractCategoryDic> kv in vo)
                {
                    if (kv.Value.contractMonthMap == null || kv.Value.contractMonthMap.Count <= 0)
                    {
                        continue;
                    }
                    if (kv.Value.id != commodityInfo.cid)
                    {
                        continue;
                    }

                    foreach (KeyValuePair <string, ContractBasePrice> kvMonth in kv.Value.contractMonthMap)
                    {
                        decimal d;
                        decimal.TryParse(kvMonth.Value.preSettlementPrice, out d);
                        this.label_StandPrice.Text = string.Format("{0:C}", d);
                        break;
                    }
                }
            }

            //需要保证金/应付保证金
            //需要保证金比例目前所有的都为10%-[hanyu]保证金比例目前查询有误
            decimal needMarginAll = Convert.ToDecimal(this.label_StandPrice.Text.Replace("¥", "").Replace(",", "")) * Convert.ToDecimal(this.comboBox_VolumnChoice.SelectedItem) * 0.1m;

            this.label_NeedMagin2.Text = string.Format("{0:C}", needMarginAll);

            //应该付 = 总需要 - 可用金额
            decimal shouldMarginLeave = needMarginAll - (Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt));

            if (shouldMarginLeave <= 0m)
            {
                this.label_NeedMargin1.Text = string.Format("{0:C}", 0m);
            }
            else
            {
                this.label_NeedMargin1.Text = string.Format("{0:C}", shouldMarginLeave);
            }

            //可用余额
            Funds accountData = HttpService.GetAccountDataInfos();

            if (accountData == null || accountData.availableAmount == "" || accountData.availableAmount == null)
            {
                this.label1_LeaveCash.Text = string.Format("{0:C}", 0m);
            }
            else
            {
                decimal avaliableAccountNum = 0m;
                decimal.TryParse(accountData.availableAmount, out avaliableAccountNum);

                if (avaliableAccountNum == 0m)
                {
                    this.label1_LeaveCash.Text = string.Format("{0:C}", 0m);
                }
                else
                {
                    this.label1_LeaveCash.Text = string.Format("{0:C}", avaliableAccountNum);
                }
            }
        }
コード例 #16
0
ファイル: DelistBrandForm.cs プロジェクト: handayu/TFS-WebKit
 /// <summary>
 ///初始化窗口控件之后设置默认值
 /// </summary>
 /// <param name="commodityInfo"></param>
 public void SetCommodityInfo(OneListed commodityInfo)
 {
     SetDefultFieldToDelistBrand(commodityInfo);
 }
コード例 #17
0
ファイル: DelistBrandForm.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 刷新参数
        /// </summary>
        /// <param name="commodityInfo"></param>
        private void RefrashArgs(OneListed commodityInfo)
        {
            CreditQuotaRequest args = new CreditQuotaRequest()
            {
                compId = commodityInfo.publisherId,
            };


            decimal canUseAvaliableMoney = 0m;
            //信用额度
            CreditQuotaResponse avaliableQuatityArgs = HttpService.GetDelistAditQuatity(args);

            if (avaliableQuatityArgs != null && avaliableQuatityArgs.data != null && avaliableQuatityArgs.data.creditLineAmt != null &&
                avaliableQuatityArgs.data.creditLineAmt != "")
            {
                canUseAvaliableMoney = Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt);
                this.label_AvaliableCridetCash.Text = string.Format("{0:C}", (Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt)));
            }
            else
            {
                canUseAvaliableMoney = 0m;
                this.label_AvaliableCridetCash.Text = string.Format("{0:C}", 0m);
            }

            //查询结算价
            Dictionary <string, ContractCategoryDic> vo = DataManager.Instance.GetContractcCategoryVo();

            if (vo == null || vo.Values.Count <= 0)
            {
                this.label_StandPrice.Text = "---";
            }
            else
            {
                foreach (KeyValuePair <string, ContractCategoryDic> kv in vo)
                {
                    if (kv.Value.contractMonthMap == null || kv.Value.contractMonthMap.Count <= 0)
                    {
                        continue;
                    }
                    if (kv.Value.id != commodityInfo.cid)
                    {
                        continue;
                    }

                    foreach (KeyValuePair <string, ContractBasePrice> kvMonth in kv.Value.contractMonthMap)
                    {
                        decimal d;
                        decimal.TryParse(kvMonth.Value.preSettlementPrice, out d);
                        this.label_StandPrice.Text = string.Format("{0:C}", d);
                        break;
                    }
                }
            }

            //需要保证金/应付保证金
            //需要保证金比例目前所有的都为10%-[hanyu]保证金比例目前查询有误
            decimal needMarginAll = Convert.ToDecimal(this.label_StandPrice.Text.Replace("¥", "").Replace(",", "")) * Convert.ToDecimal(this.comboBox_VolumnChoice.SelectedItem) * 0.1m;

            this.label_NeedMagin2.Text = string.Format("{0:C}", needMarginAll);

            //应该付 = 总需要 - 可用金额
            decimal shouldMarginLeave = needMarginAll - (Convert.ToDecimal(avaliableQuatityArgs.data.creditLineAmt) - Convert.ToDecimal(avaliableQuatityArgs.data.creditUsedAmt));

            if (shouldMarginLeave <= 0m)
            {
                this.label_NeedMargin1.Text = string.Format("{0:C}", 0m);
            }
            else
            {
                this.label_NeedMargin1.Text = string.Format("{0:C}", shouldMarginLeave);
            }

            //可用余额
            Funds accountData = HttpService.GetAccountDataInfos();

            if (accountData == null || accountData.availableAmount == "" || accountData.availableAmount == null)
            {
                this.label1_LeaveCash.Text = string.Format("{0:C}", 0m);
            }
            else
            {
                decimal avaliableAccountNum = 0m;
                decimal.TryParse(accountData.availableAmount, out avaliableAccountNum);

                if (avaliableAccountNum == 0m)
                {
                    this.label1_LeaveCash.Text = string.Format("{0:C}", 0m);
                }
                else
                {
                    this.label1_LeaveCash.Text = string.Format("{0:C}", avaliableAccountNum);
                }
            }
        }