/// <summary> /// 拉取合约和仓库信息 /// </summary> public void GetContract() { #region 拉取合约 var contract = HttpService.GetContract(); if (contract != null && contract.Success && contract.data != null) { currentCategory = null; currentCode = null; CurrentContractCode = null; categoryDY.Clear(); lastPriceDY.Clear(); var ContractData = contract.data; if (ContractData.categoryVoMap != null) { categoryDY = ContractData.categoryVoMap; #region 拉取仓库信息 wareHouses.Clear(); foreach (var v in ContractData.categoryVoMap.Values) { var WareHouseInfo = HttpService.GetWareHouseInfo(v.id); if (WareHouseInfo != null && WareHouseInfo.Success && WareHouseInfo.Result != null) { foreach (var v2 in WareHouseInfo.Result) { if (!wareHouses.ContainsKey(v2.id)) { wareHouses.Add(v2.id, v2); } } } } #endregion } if (ContractData.lastPriceMap != null) { lastPriceDY = ContractData.lastPriceMap; } CurrentCode = "cu"; UpdataAllContractEvent?.Invoke(); } #endregion }
/// <summary> /// 查询所有仓库列表 /// </summary> private void QueryHttpWareHouseToCombox(string nowProcessId) { try { WareHouseResponse wareHouseInfo = HttpService.GetWareHouseInfo(nowProcessId); if (wareHouseInfo == null || wareHouseInfo.Result == null) { return; } foreach (WareHouseInfo info in wareHouseInfo.Result) { this.comboBox_WareHouse.Items.Add(info); } } catch (Exception ex) { throw new Exception("供需发布初始化仓库列表信息异常:" + ex.Message); } }