public void Exec(String Command, params object[] Params) { using(var Instance = new NSIEntities()) { Instance.Database.ExecuteSqlCommand(Command, Params); } }
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 Exec(String Command, params object[] Params) { using (var Instance = new NSIEntities()) { Instance.Database.ExecuteSqlCommand(Command, Params); } }
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 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); }
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; }