private void FillEquipmentsList() { using (AppDBEntities context = new AppDBEntities()) { this.equipments = context.Equipments.OrderBy(x => x.Name).ToList(); } }
private void FillColorsList() { using (AppDBEntities context = new AppDBEntities()) { this.colors = context.Colors.OrderBy(x => x.Name).ToList(); ; } }
private void FillBranchesList() { using (AppDBEntities context = new AppDBEntities()) { this.branches = context.Branches.OrderBy(x => x.Name).ToList(); } }
// Fills models list for specified make public void FillModelsList(int makeId) { using (AppDBEntities context = new AppDBEntities()) { this.models = (from m in context.Models where m.Id_make == makeId select m).OrderBy(x => x.Name).ToList(); } }
// Fills info and equipments list with variants and prices for specified model public void FillModel(int modelId) { using (AppDBEntities context = new AppDBEntities()) { this.currentModel = (from m in context.Models where m.Id == modelId select m).FirstOrDefault(); this.equipmentPrices = (from ep in context.EquipmentPrices where ep.Id_model == modelId select new EquipmentPrice { Id = ep.Id, Name = ep.Equipment.Name, Price = ep.Price }).ToList(); this.MakeName = this.CurrentModel.Make.Name; } }
private void FillMakesList() { using (AppDBEntities context = new AppDBEntities()) { //DbSet<Make> ds = context.Makes; this.makes = context.Makes.OrderBy(x => x.Name).ToList(); } }