/// <summary> /// 构建材料类别树 /// </summary> /// <param name="treeView">要构建的树</param> /// <returns>成功返回true</returns> static public bool BuildTree(TreeView treeView) { // 仓库信息服务 IMaterialTypeServer depotServer = ServerModuleFactory.GetServerModule <IMaterialTypeServer>(); try { IQueryable <View_S_Depot> depot = null; string error = null; if (depotServer.GetAllMaterialType(out depot, out error)) { InitTreeView(treeView, depot.ToList()); } return(true); } catch (Exception err) { MessageDialog.ShowErrorMessage(err.Message); return(false); } }