Esempio n. 1
0
        public StatusController(CarToGoDataContext _context, StatusAppService StatusAppService)
        {
            _baseDatos        = _context;
            _statusAppService = StatusAppService;

            if (_baseDatos.Statuses.Count() == 0)
            {
                _baseDatos.Statuses.Add(new Status {
                    Name = "Disponible"
                });
                _baseDatos.SaveChanges();
            }
        }
        public PhotoController(CarToGoDataContext _context, PhotoAppService PhotoAppService)
        {
            _baseDatos       = _context;
            _photoAppService = PhotoAppService;

            if (_baseDatos.Photos.Count() == 0)
            {
                _baseDatos.Photos.Add(new Photo {
                    Front = "Foto de Frente"
                });
                _baseDatos.SaveChanges();
            }
        }
        public ConditionController(CarToGoDataContext _context, ConditionAppService ConditionAppService)
        {
            _baseDatos           = _context;
            _conditionAppService = ConditionAppService;

            if (_baseDatos.Conditions.Count() == 0)
            {
                _baseDatos.Conditions.Add(new Condition {
                    Name = "Usado"
                });
                _baseDatos.SaveChanges();
            }
        }
Esempio n. 4
0
        public CarController(CarToGoDataContext _context, CarAppService carAppService)
        {
            _dataBase      = _context;
            _carAppService = carAppService;

            if (_dataBase.Cars.Count() == 0)
            {
                _dataBase.Cars.Add(new Car {
                    ModelId = 1, PhotoId = 1, Year = 2014, Color = "Black", StatusId = 1, SellerId = 1, ConditionId = 1
                });
                _dataBase.SaveChanges();
            }
        }
Esempio n. 5
0
        public BrandController(CarToGoDataContext _context, BrandAppService BrandAppService)
        {
            _baseDatos       = _context;
            _brandAppService = BrandAppService;

            if (_baseDatos.Brands.Count() == 0)
            {
                _baseDatos.Brands.Add(new Brand {
                    Name = "Hyundai"
                });
                _baseDatos.SaveChanges();
            }
        }
        public SellerController(CarToGoDataContext _context, SellerAppService SellerAppService)
        {
            _baseDatos        = _context;
            _sellerAppService = SellerAppService;

            if (_baseDatos.Sellers.Count() == 0)
            {
                _baseDatos.Sellers.Add(new Seller {
                    Name = "Daniel Rodriguez"
                });
                _baseDatos.SaveChanges();
            }
        }
Esempio n. 7
0
        public ModelController(CarToGoDataContext _context, ModelAppService modelAppService)
        {
            _dataBase        = _context;
            _modelAppService = modelAppService;


            if (_dataBase.Models.Count() == 0)
            {
                _dataBase.Models.Add(new Model {
                    Name = "Creta", BrandId = 1
                });
                _dataBase.SaveChanges();
            }
        }