private void FocusedNode() { if (treeListStockHouse.FocusedNode == null) { return; } List <Alading.Entity.StockHouse> stockHouseList = (List <Alading.Entity.StockHouse>)treeListStockHouse.DataSource; Alading.Entity.StockHouse stockHouse = stockHouseList[treeListStockHouse.FocusedNode.Id];// stockHouseList[e.Node.Id]; if (stockHouse != null) { textHouseAddr.Text = stockHouse.HouseAddress; textHouseName.Text = stockHouse.HouseName; textEditHouseCode.Text = stockHouse.StockHouseCode; textContact.Text = stockHouse.HouseContact; memoHouseRemark.Text = stockHouse.HouseRemark; stockHouseCode = stockHouse.StockHouseCode; LoadLayout(stockHouse.StockHouseCode); } }
/// <summary> /// 仓库修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barModifyHouse_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (treeListStockHouse.FocusedNode == null) { return; } if (stockHouseCode == Constants.DEFAULT_STOCKHOUSE_CODE) { XtraMessageBox.Show("系统默认仓库,不能修改", Constants.SYSTEM_PROMPT); return; } List <Alading.Entity.StockHouse> stockHouseList = (List <Alading.Entity.StockHouse>)treeListStockHouse.DataSource; Alading.Entity.StockHouse stockHouse = stockHouseList[treeListStockHouse.FocusedNode.Id]; if (stockHouse != null) { ModifyHouse modifyHouse = new ModifyHouse(stockHouse); modifyHouse.ShowDialog(); Init(); } }