public bool RegisterDriver([FromUri] int userid) { ParkRepo = new ParkRepository(); ParkRepo.RegisterDriver(userid); return(true); }
public DevDatabaseInitializer(ParkRepository parkRepository, ParkObjectRepository parkObjectRepository, IUnitOfWork unitOfWork, SoloDbContext soloDbContext, UserRepository userRepository) { _parkRepository = parkRepository; _parkObjectRepository = parkObjectRepository; _unitOfWork = unitOfWork; _soloDbContext = soloDbContext; _userRepository = userRepository; }
public async Task <string> CreateEmployee([FromUri] string NIN, [FromUri] int type, [FromUri] int ParkID) { ParkRepo = new ParkRepository(); UserRepo = new UserRepository(); ParkRepo.CreateEmployee((await UserRepo.GetUser(NIN)).ID, type, ParkID); return("Employee Created Successfully"); }
public Response ExitParking([FromUri] int UserID, [FromUri] int ParkID, [FromUri] int CarID) { ParkRepo = new ParkRepository(); Response rsp = new Response(); ParkRepo.ExitParking(UserID, CarID, ParkID, out rsp); return(rsp); }
public ParkRepositoryTest() { var _configuration = ConfigHelper.GetConfig(); string cs = _configuration.GetConnectionString("MongoDb").ToString(); string dbName = _configuration.GetSection("MongoDbConnectionName").Value.ToString(); string collectionName = _configuration.GetSection("ParkCollection").Value.ToString(); var _dbcontext = new MongoDbContext(cs, dbName); _parkRepository = new ParkRepository(_dbcontext, collectionName); }
public ParkRepositoryTests() { _logger = new Mock <ILogger <ParkRepository> >(); var myConfiguration = new Dictionary <string, string> { { "ConnectionStrings:LocalParks", "Data Source=:memory:;Version=3;New=True;" } }; _configuration = new ConfigurationBuilder() .AddInMemoryCollection(myConfiguration) .Build(); _options = new DbContextOptionsBuilder <ParkContext>() .UseInMemoryDatabase(databaseName: "ParkRepositoryTests") .Options; _context = new ParkContext(_options, _configuration); _repository = new ParkRepository(_context, _logger.Object); }
public void CreateEmployee([FromUri] int UserID, [FromUri] int ParkID) { ParkRepo = new ParkRepository(); ParkRepo.CreateEmployee(UserID, ParkID); }
public ParksController(ParkRepository parkRepository) { _parkRepository = parkRepository; }
public List <History> GetParkingHistory([FromUri] int ParkID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetParkHistory(ParkID)); }
public ParkTicket GetTicket([FromUri] int ParkID, [FromUri] int CarID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetTicket(ParkID, CarID)); }
public bool GetParking([FromUri] int ParkID, [FromUri] int CarID, [FromUri] int UserID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetParking(ParkID, CarID, UserID)); }
public User GetCarDriver([FromUri] int Car, [FromUri] int Park) { ParkRepo = new ParkRepository(); return(ParkRepo.GetCarDriver(Car, Park)); }
public bool CheckCar([FromUri] string License) { ParkRepo = new ParkRepository(); return(ParkRepo.CarExists(License)); }
public ParkTicket GetTicket(int ID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetTicket(ID)); }
public int GetUser([FromBody] string fingerprint) { ParkRepo = new ParkRepository(); return(ParkRepo.GetUser(new ImageConverter().ToBitmap(new ImageConverter().ToByteArr(fingerprint)))); }
public InfoWindow(LayoutInflater inflater) { this.inflater = inflater; this.parkRepository = new ParkRepository(); }
public ParkingYard Parks(int ID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetParkingYard(ID)); }
public ParkingYard [] Parks() { ParkRepo = new ParkRepository(); return(ParkRepo.GetParkingYards()); }
public async Task <JObject> Parks([FromUri] double lat, [FromUri] double lng) { maps mp = new maps(); Response Response = new Response(); Response = await mp.GetNearByPlaces(lat, lng, "parking", 10000); JObject Error = new JObject(); if (Response.Code == 200) { Error.Add("Code", Response.Code); Error.Add("Message", "Success"); ParkingYard Yard = new ParkingYard(); JArray jarr = JArray.Parse(Response.Data); for (int count = 0; count < jarr.Count; count++) { Yard.Image = jarr[count]["place image"].ToString(); Yard.Name = jarr[count]["name"].ToString(); Yard.Place_ID = jarr[count]["place_id"].ToString(); Yard.Reference = jarr[count]["reference"].ToString(); ParkingYard.YardLocation YardLocation = new ParkingYard.YardLocation(); YardLocation.Name = jarr[count]["vicinity"].ToString(); YardLocation.Latitude = Convert.ToDouble(jarr[count]["geometry"]["location"]["lat"]); YardLocation.Longitude = Convert.ToDouble(jarr[count]["geometry"]["location"]["lng"]); Yard.Location = YardLocation; ParkRepo = new ParkRepository(); if (await ParkRepo.CreateParkingYard(Yard)) { Response.Message = "Parking Created Successfully"; } else { Response.Message = "Parking Already exists"; } JObject Parking = new JObject(); ParkingYard py = ParkRepo.GetParkingYard(Yard.Place_ID); JObject Space = new JObject(); Space.Add("space id", py.Spaces.Space_ID); Space.Add("space count", py.Spaces.Count); Space.Add("used spaces", py.Spaces.UsedSpaces); JObject Location = new JObject(); Location.Add("id", py.Location.id); Location.Add("name", py.Location.Name); Parking.Add("park_id", py.id); Parking.Add("Space", Space); Parking.Add("Location", Location); JObject FinalJarr = (JObject)jarr[count]; FinalJarr.Add("Park Data", Parking); jarr[count] = FinalJarr; } // JArray FinalJSONArray = (JArray)jarr; Error.Add("values", jarr); } else { Error.Add("Code", Response.Code); Error.Add("Message", Response.Message); Error.Add("Values", Response.Data); } return(Error); }
public int RegisterCar([FromUri] string License) { ParkRepo = new ParkRepository(); return(ParkRepo.GetCarID(License)); }
public List <ParkingYard.Activities> GetActivities([FromUri] int ID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetActivities(ID)); }
public List <Employees> Employees([FromUri] int ID) { ParkRepo = new ParkRepository(); return(ParkRepo.GetEmployees(ID)); }