Exemple #1
0
        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;
        }
Exemple #2
0
        public void Explode(IExplodable Target)
        {
            if(Target is Element == false)
            {
                throw new ArgumentException();
            }
            this.Target = Target as Element;

            ExplodeContent();
            GetContent();
          

        }
Exemple #3
0
        public Element FindAncestor(Element Parent)
        {
            var Result = this.Parent;
            while(Result != Parent)
            {

                Result = Result.Parent;
                if(Result == null)
                {
                    break;
                }
            }
            return Result;
        }
Exemple #4
0
        public static Element Root()
        {
            var Result = new Element();
            Result.Index = "0000";
            Result.Denotation = "00000000000";
            Result.Depth = -1;

            return Result;
        }
Exemple #5
0
 public void Delete(Element Department)
 {
     throw new NotImplementedException();
 }
Exemple #6
0
        //public Element Find(Expression<Func<ConstSP, Boolean>>)
        //{

        //}

        public void Insert(Element Department)
        {
            throw new NotImplementedException();
        }