/// TODO : REMOVE MAGIC STRING public IEnumerable <Element> SelectAll() { var Result = new List <Element>(); using (var Context = new ConstDocsEntities()) { var id = "NetGraph" + Counter; var RawResult = Context.tempPOSPRIMB .Where(x => x.id == id).OrderBy(x => x.TIP).ToList(); foreach (tempPOSPRIMB Record in RawResult) { var MockParent = new Element() { Id = Record.Parent //Index = Record.IND2, //Denotation = Record.P2NI, //Type = ElementType.Block, //Depth = Record.Depth - 1 }; var Element = new Element() { Id = Record.id_record, Type = EnumHelper.FindInDesc <ElementType>(Record.TIP), Index = Record.IND1, Denotation = Record.PICH, Depth = Record.Depth, Parent = MockParent, Amount = Record.KSP.Value }; Result.Add(Element); } } return(Result); }
/// TODO : REMOVE MAGIC STRING public IEnumerable<Element> SelectAll() { var Result = new List<Element>(); using(var Context = new ConstDocsEntities()) { var id = "NetGraph" + Counter; var RawResult = Context.tempPOSPRIMB .Where(x => x.id == id ).OrderBy(x => x.TIP).ToList(); foreach(tempPOSPRIMB Record in RawResult) { var MockParent = new Element() { Id = Record.Parent //Index = Record.IND2, //Denotation = Record.P2NI, //Type = ElementType.Block, //Depth = Record.Depth - 1 }; var Element = new Element() { Id = Record.id_record, Type = EnumHelper.FindInDesc<ElementType>(Record.TIP), Index = Record.IND1, Denotation = Record.PICH, Depth = Record.Depth, Parent = MockParent, Amount = Record.KSP.Value }; Result.Add(Element); } } return Result; }
public IEnumerable <Department> SelectAll() { List <Department> Result = new List <Department>(); using (var Context = new ConstDocsEntities()) { var SearchResult = Context.RootWorks; foreach (var Row in SearchResult) { Department Department = new Department(); Department.Id = Convert.ToInt32(Row.C); Department.ShortName = Row.C.ToString(); Department.Name = Row.C.ToString(); Department.Duration = Row.Duration ?? 0; Department.Color = ColorHelper.Random((int)Row.C); // Department.ColorCode = Department.Color.ToInt(); Result.Add(Department); } } return(Result); }
public IEnumerable<Department> SelectAll() { List<Department> Result = new List<Department>(); using (var Context = new ConstDocsEntities()) { var SearchResult = Context.RootWorks; foreach(var Row in SearchResult) { Department Department = new Department(); Department.Id = Convert.ToInt32(Row.C); Department.ShortName = Row.C.ToString(); Department.Name = Row.C.ToString(); Department.Duration = Row.Duration ?? 0; Department.Color = ColorHelper.Random((int)Row.C); // Department.ColorCode = Department.Color.ToInt(); Result.Add(Department); } } return Result; }