public ActionResult <TrafficIntensityVM> GetIntensityWithAccuracy(double latitude, double longitude, int accuracy) { var localization = new PlaceLocalization( new Coordinate(latitude, longitude) ); return(TrafficMapper.TrafficIntensityToViewModel( _Integrator.GetTrafficIntensityWithAccuracy(localization, accuracy) )); }
protected void Traffic_Click(object sender, EventArgs e) { BPerson bus = new BPerson(); Person prs = bus.GetByUsername("Salavati"); prs.InitializeForTrafficMapper(Convert.ToDateTime("2012-07-20"), Convert.ToDateTime("2012-12-20")); TrafficMapper tm = new TrafficMapper(bus.GetByUsername("Salavati")); tm.DoMap(); //BEngineCalculator bus1 = new BEngineCalculator(); //bus1.Calculate(bus.GetByUsername("Salavati").ID, Utility.ToString(DateTime.Now.AddMonths(2))); }
public void Execute(decimal PersonId, DateTime FromDate, DateTime ToDate) { using (NHibernateSessionManager.Instance.BeginTransactionOn()) { try { Person prs = Person.GetPersonRepository(false).GetById(PersonId, false); prs.InitializeForTrafficMapper(FromDate, ToDate); TrafficMapper tm = new TrafficMapper(prs, FromDate, ToDate); tm.DoMap(); NHibernateSessionManager.Instance.CommitTransactionOn(); tm.Dispose(); } catch (Exception ex) { //gtsRuleLogger.Flush(); NHibernateSessionManager.Instance.RollbackTransactionOn(); throw; } } }
/// <summary> /// سازنده /// جهت اجرا از بیرون /// </summary> /// <param name="mapper"></param> /// <param name="person"></param> public TrafficSync(TrafficMapper mapper, Person person) { _person = person; _mapper = mapper; }
public ActionResult <TrafficIntensityVM> GetIntensity() { return(TrafficMapper.TrafficIntensityToViewModel( _Integrator.GetTrafficIntensity() )); }