Exemple #1
0
 public void SetMakeItems(IEnumerable <Make> makes)
 {
     foreach (var make in makes)
     {
         Makes.Add(make);
     }
 }
        public Make AddMake(Make toAdd, string userId)
        {
            var user = Users.Single(u => u.Id == userId);

            toAdd.UserAddedBy = user;
            Makes.Add(toAdd);
            SaveChanges();
            return(toAdd);
        }
Exemple #3
0
 public void SetMakes(IEnumerable <VehicleMake> vehicleMake)
 {
     foreach (var make in vehicleMake)
     {
         Makes.Add(new SelectListItem()
         {
             Value = make.VehicleMakeId.ToString(),
             Text  = make.Make
         });
     }
 }
 public void SetMakes(IEnumerable <MakeModel> makes)
 {
     foreach (var make in makes)
     {
         Makes.Add(new SelectListItem()
         {
             Value = make.Make,
             Text  = make.Make
         });
     }
 }
Exemple #5
0
 public void SetMakes(IEnumerable <Makes> makes)
 {
     foreach (var m in makes)
     {
         Makes.Add(new SelectListItem()
         {
             Value = m.MakeId.ToString(),
             Text  = m.Description.ToString()
         });
     }
 }
Exemple #6
0
        public Make AddMake(string makeName, int adminId)
        {
            Make newMake = new Make();

            newMake.MakeId   = Makes.Max(i => i.MakeId) + 1;
            newMake.MakeName = makeName;
            newMake.AdminId  = adminId;
            newMake.Created  = DateTime.Now;
            Makes.Add(newMake);
            (this).SaveChanges();
            return(newMake);
        }
        public void SetMakesAndModels(Manager manager)
        {
            AllMakes  = manager.GetAllMakes();
            AllModels = manager.GetAllModels();

            foreach (var make in AllMakes)
            {
                Makes.Add(new SelectListItem
                {
                    Text  = make.Name,
                    Value = make.Id.ToString()
                });
            }
        }
 private void InitializeMakes()
 {
     this.Makes = new List <string>();
     Makes.Add("Land Rover");
     Makes.Add("Jaguar");
     Makes.Add("Mini");
     Makes.Add("Porche");
     Makes.Add("Volkswagen");
     Makes.Add("Audi");
     Makes.Add("Toyota");
     Makes.Add("Vaxhaul");
     Makes.Add("Peugeot");
     Makes.Add("Skoda");
     Makes.Add("Lexus");
 }
Exemple #9
0
        public void Copy(MakeCollection response)
        {
            Makes.Clear();
            foreach (var make in response.Makes)
            {
                var eMake = new EdmundsMake(make.Id, make.Name, make.NiceName, make.Manufacturer);

                foreach (var eModel in make.Models.Select(model => new EdmundsModel(model.Link, model.Id, model.Name)))
                {
                    eMake.Models.Add(eModel);
                }

                Makes.Add(eMake);
            }
        }
Exemple #10
0
        private void OnAddMake(UserPromptViewModel result)
        {
            if (result == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(result.FirstInput))
            {
                var make = new TachographMake {
                    Name = result.FirstInput
                };
                Makes.Add(make);
                Repository.Add(make);
            }
        }
Exemple #11
0
 private void AddMakeExecute()
 {
     Makes.Add(new Make());
 }