public List <DatabaseHierarchyNode> RenderORSElementsModulyRoot(DatabaseHierarchyNode staticData) { List <DatabaseHierarchyNode> result = new List <DatabaseHierarchyNode>(); if (GetElementTypesHierarchyNode((int)staticData.Parent.Parameter).Any()) { var node = staticData.Clone(); //node.Parameter = element.C_OrsElement_Id; node.Nazov = "Organization structure"; result.Add(node); } return(result); }
public List <DatabaseHierarchyNode> RenderModuly(DatabaseHierarchyNode staticData) { var result = new List <DatabaseHierarchyNode>(); foreach (var modul in EsamModules) { var node = staticData.Clone(); node.Parameter = modul.C_Modul_Id; node.Nazov = $" {modul.Kod} - {modul.Nazov}"; result.Add(node); } return(result); }
public List <DatabaseHierarchyNode> RenderORSElementTypesModuly(DatabaseHierarchyNode staticData) { var elementyCache = GetElementTypesHierarchyNode((int)staticData.Parent.Parent.Parameter); var result = new List <DatabaseHierarchyNode>(); foreach (var element in elementyCache) { var node = staticData.Clone(); node.Parameter = element.C_OrsElementType_Id; node.Nazov = element.DbView; result.Add(node); } return(result); }
public List <DatabaseHierarchyNode> RenderORSElementsModuly(DatabaseHierarchyNode staticData) { //List<int> ORSet = GetElementTypesHierarchyNode(IdModul).Select(o => o.C_OrsElementType_Id).ToList(); //List<DatabaseHierarchyNode> result = GetModulyHierarchyNode(staticData, (int)staticData.Parent.Parent.Parent.Parameter); List <OrsElement> elementyCache = GetCacheOptimized($"cfe:ORSElements", () => { return(GetList <OrsElement>()); }, new TimeSpan(24, 0, 0)); var result = new List <DatabaseHierarchyNode>(); foreach (var element in elementyCache.Where(e => e.C_OrsElementType_Id == (int)staticData.Parent.Parameter)) { var node = staticData.Clone(); node.Parameter = element.C_OrsElement_Id; node.Nazov = element.ListValue; result.Add(node); } return(result); }
public List <DatabaseHierarchyNode> RenderCisTree(string code, DatabaseHierarchyNode staticData) { var result = new List <DatabaseHierarchyNode>(); var reader = Db.ExecuteReader($@"SELECT tbek.Nazov AS Item1, tbek.Kod as Item2, tbek.C_TypBiznisEntity_Kniha_Id as Item3 FROM reg.V_TypBiznisEntity_Kniha tbek LEFT JOIN reg.V_TypBiznisEntity tbe ON tbe.C_TypBiznisEntity_Id = tbek.C_TypBiznisEntity_Id LEFT JOIN reg.V_TypBiznisEntityNastav tben ON tben.C_TypBiznisEntity_Id = tbek.C_TypBiznisEntity_Id Where tben.EvidenciaSystem = 1 AND tben.CislovanieJedno = 0 AND tbe.KodORS = '{code}' ORDER BY tbek.Poradie"); var data = reader.Parse <Tuple <string, string, int> >().ToList(); reader.Close(); foreach (var item in data) { var node = staticData.Clone(); node.Parameter = item.Item3; // (item.Item3 < 0)? (item.Item3 * -1) : item.Item3 + 1000; node.Nazov = $" Číslovanie - {item.Item1}"; result.Add(node); } return(result); }