Beispiel #1
0
        public JsonResult CreateBusLine(string name, string url, int busMarkerId)
        {
            var busLine = new BusLine(name, url);
            busLine = busLineService.Create(busLine, busMarkerId);

            return Json(busLine);
        }
Beispiel #2
0
        public BusLine Create(BusLine busLine)
        {
            using (var client = Server.OpenClient())
            {
                busLine.Id = busLine.GetHashCode();
                client.Store(busLine);
            }

            return busLine;
        }
Beispiel #3
0
        public BusLine Create(BusLine busLine, int busMarkerId)
        {
            var storedBusLine = busLineRepository.Get(busLine.Name);

            if (storedBusLine == null)
            {
                storedBusLine = busLineRepository.Create(busLine);
            }

            busMarkerRepository.AddLine(busMarkerId, storedBusLine.Id);

            return storedBusLine;
        }