Ejemplo n.º 1
0
 public void Exec(String Command, params object[] Params)
 {
     using(var Instance = new NSIEntities())
     {
         Instance.Database.ExecuteSqlCommand(Command, Params);
     }
 }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
0
 public void Exec(String Command, params object[] Params)
 {
     using (var Instance = new NSIEntities())
     {
         Instance.Database.ExecuteSqlCommand(Command, Params);
     }
 }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public Department SelectById(Int32 Id)
        {
            Department Result = null;

            using (var Context = new NSIEntities())
            {
                var SearchResult = Context.PDivision.FirstOrDefault(x => x.ID == Id);
                if (SearchResult != null)
                {
                    Result           = new Department();
                    Result.Id        = SearchResult.ID;
                    Result.ShortName = SearchResult.Name;
                    //Result.ColorCode = ColorHelper.Random().ToInt();
                }
            }
            return(Result);
        }
Ejemplo n.º 6
0
        public Department SelectById(Int32 Id)
        {
            Department Result = null;
            using(var Context = new NSIEntities())
            {

                var SearchResult = Context.PDivision.FirstOrDefault(x => x.ID == Id);
                if(SearchResult != null)
                {
                    Result = new Department();
                    Result.Id = SearchResult.ID;
                    Result.ShortName = SearchResult.Name;
                    //Result.ColorCode = ColorHelper.Random().ToInt();
                    
                }
            }
            return Result;
        }