示例#1
0
        public carEditModel(IVehicleTypeRepository _vehicleTypeRepo,
                            ICarRepository _carRepo,
                            IBrandRepository _brandRepo,
                            LendCarDBContext Context,
                            IBrandModelRepository _brandModelRepo,
                            IWebHostEnvironment _hostEnvironment,
                            UserManager <ApplicationUser> _userManager
                            )
        {
            vehicleTypeRepo = _vehicleTypeRepo;
            carRepo         = _carRepo;
            brandRepo       = _brandRepo;
            brandModelRepo  = _brandModelRepo;
            _context        = Context;
            hostEnvironment = _hostEnvironment;
            userManager     = _userManager;

            VehicleTypes = new SelectList(vehicleTypeRepo.GetAllVehicleTypes().OrderBy(vt => vt.Type), "Id", "Type");
            Brands       = new SelectList(brandRepo.GetAllBrands().OrderBy(b => b.Name), "Id", "Name");
            OdoMeters    = new SelectList(carRepo.Context.OdoMeters.ToList(), "Id", "Value");
            Colors       = new SelectList(carRepo.Context.Colors.OrderBy(c => c.Name).ToList(), "Id", "Name");
            Vehicle      = new Vehicle();
            Cities       = new SelectList(carRepo.Context.Cities.OrderBy(c => c.Name).ToList(), "Id", "Name");
            Today        = DateTime.Now.Date;
        }
 public ClientRepository(LendCarDBContext context,
                         ICarRepository carRepository,
                         IUserRepository userRepository)
 {
     Context        = context;
     CarRepository  = carRepository;
     UserRepository = userRepository;
 }
示例#3
0
 public RegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     LendCarDBContext Context,
     RoleManager <IdentityRole> roleManager,
     IWebHostEnvironment hostEnvironment
     )
 {
     _userManager     = userManager;
     _signInManager   = signInManager;
     _logger          = logger;
     _context         = Context;
     _roleManager     = roleManager;
     _hostEnvironment = hostEnvironment;
     Cities           = new SelectList(_context.Cities.OrderBy(c => c.Name).ToList(), "Id", "Name");
     Genders          = new SelectList(_context.Genders.ToList(), "Id", "Type");
 }
示例#4
0
 public CarRepository(LendCarDBContext Context)
 {
     this.Context = Context;
 }
示例#5
0
 public BrandRepository(LendCarDBContext context)
 {
     this.Context = context;
 }
示例#6
0
 public VehicleTypeRepository(LendCarDBContext context)
 {
     this.Context = context;
 }
示例#7
0
 public ColorRepository(LendCarDBContext context)
 {
     this.Context = context;
 }
 public ContactRepository(LendCarDBContext context)
 {
     Context = context;
 }
示例#9
0
 public PersonRepository(LendCarDBContext Context)
 {
     this.Context = Context;
 }
示例#10
0
 public CityRepostiory(LendCarDBContext context)
 {
     Context = context;
 }