Esempio n. 1
0
 private void FillEquipmentsList()
 {
     using (AppDBEntities context = new AppDBEntities())
     {
         this.equipments = context.Equipments.OrderBy(x => x.Name).ToList();
     }
 }
Esempio n. 2
0
 private void FillColorsList()
 {
     using (AppDBEntities context = new AppDBEntities())
     {
         this.colors = context.Colors.OrderBy(x => x.Name).ToList(); ;
     }
 }
Esempio n. 3
0
 private void FillBranchesList()
 {
     using (AppDBEntities context = new AppDBEntities())
     {
         this.branches = context.Branches.OrderBy(x => x.Name).ToList();
     }
 }
Esempio n. 4
0
 // 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();
     }
 }
Esempio n. 5
0
        // 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;
            }
        }
Esempio n. 6
0
 private void FillMakesList()
 {
     using (AppDBEntities context = new AppDBEntities())
     {
         //DbSet<Make> ds = context.Makes;
         this.makes = context.Makes.OrderBy(x => x.Name).ToList();
     }
 }