/// <summary> /// Returns a reference to the <see cref="Tracker"/> class object. /// </summary> /// <param name="solver">The solver to be used by the returned tracker.</param> /// <param name="geocoder">The geocoder to be used by the returned tracker.</param> /// <param name="messageReporter">The messageReporter to be used by the returned /// tracker.</param> /// <returns>A new <see cref="Tracker"/> class instance.</returns> /// <exception cref="ArgumentNullException"><paramref name="solver"/>, /// <paramref name="geocoder"/> or <paramref name="messageReporter"/> is a null /// reference.</exception> public Tracker GetTracker( IVrpSolver solver, IGeocoder geocoder, IMessageReporter messageReporter) { CodeContract.RequiresNotNull("solver", solver); CodeContract.RequiresNotNull("geocoder", geocoder); CodeContract.RequiresNotNull("messageReporter", messageReporter); _CheckSettings(_settings); var settings = new TrackingSettings { BreakTolerance = _settings.TrackingSettings.BreakTolerance ?? 0, }; var uri = new Uri(_settings.TrackingServiceInfo.RestUrl); var service = FeatureService.Create(uri, Server); var trackingServiceClient = new TrackingServiceClient(service); var trackingService = new TrackingServiceClient(service); var synchronizationService = new SynchronizationService(trackingServiceClient); return(new Tracker( settings, trackingService, synchronizationService, solver, geocoder, messageReporter)); }
public ActionResult CreateEdit(Feature feat) { if (feat.FeatureId == 0) { featSrv.Create(feat); } else { featSrv.Update(feat); } return(RedirectToAction("Index")); }
public JsonResult Create(Feature feature) { feature.Initialization(ObjectInitType.Insert, "", HttpContext); int result = featureService.Create(feature); _hubContext.Clients.All.SendAsync("dataChangeNotification", null); if (result != 0) { return(Json(new { messageType = "success", note = AppGlobal.InsertSuccessMessage })); } else { return(Json(new { messageType = "error", note = AppGlobal.InsertFailMessage })); } }