public Order SelectByCode(String Code) { Order Result = null; using (var Context = new NSIEntities()) { var SearchResult = Context.Zakaz.FirstOrDefault(x => x.zakaz == Code); if (SearchResult != null) { Result = new Order(); Result.Code = Code; Result.Name = SearchResult.NaimZak; } // PTP = "00" - planned, "02" - unplanned IEnumerable<ZakazVPR> Content = Context.ZakazVPR. Where(x => x.Z == Code && x.PTP == "00").ToList(); foreach(var Record in Content) { var Element = new Element() { Type = ElementType.Block, Index = Record.IND_CH, Denotation = Record.OBOZN_CH, Amount = Record.KSP ?? 1 }; Result.Content.Add(Element); } } return Result; }
public void Explode(IExplodable Target) { if(Target is Element == false) { throw new ArgumentException(); } this.Target = Target as Element; ExplodeContent(); GetContent(); }
public Element FindAncestor(Element Parent) { var Result = this.Parent; while(Result != Parent) { Result = Result.Parent; if(Result == null) { break; } } return Result; }
public static Element Root() { var Result = new Element(); Result.Index = "0000"; Result.Denotation = "00000000000"; Result.Depth = -1; return Result; }
public void Delete(Element Department) { throw new NotImplementedException(); }
//public Element Find(Expression<Func<ConstSP, Boolean>>) //{ //} public void Insert(Element Department) { throw new NotImplementedException(); }