public LoginResponse LoginUser(Login user) { LoginResponse lr = loginRepos.LoginUser(user); if (lr != null) //Update Cache { CacheImplementor.UpdateUser(lr); } return(lr); }
public void UpdateTripPersonStatus(string TripID, int EmployeeID, string Status, int UpdateUserId) { EventDef eventDef = EventDef.EMPLOYEESHOW; switch (Status.ToUpper().Trim()) { case "NOSHOW": eventDef = EventDef.EMPLOYEENOSHOW; break; } CacheImplementor.UpdateTripShows(TripID, eventDef, EmployeeID); tripRepos.UpdateTripPersonStatus(TripID, EmployeeID, Status, UpdateUserId); MQManager.PushTripInfo(TripID, EmployeeID, eventDef); }
private void HandleStopTrip(MQBatchRequest batchRequest) { Trip currTrip = CacheImplementor.GetTrip(batchRequest.MessageData.ToString()); foreach (KeyValuePair <int, TripPerson> kv in currTrip.PassengarInfo) { LoginResponse lr = CacheImplementor.GetUserInfo(kv.Value.ID.ToString()); if (lr != null && !String.IsNullOrEmpty(lr.FirebaseID)) { PushCommunication.SendNotification(lr.FirebaseID, "TRIP STARTED", String.Format("Your trip had been started and Driver: {0} Number: {1] is assigned", currTrip.DriverData.DriverName, currTrip.DriverData.DriverPhoneNumber)); } } }
public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext actionContext) { if (actionContext.Request.Headers.Authorization == null) { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized); } else { string authenticationString = actionContext.Request.Headers.Authorization.Parameter; string token = Encoding.UTF8.GetString(Convert.FromBase64String(authenticationString)); LoginResponse lr = CacheImplementor.GetUserInfo(token); if (lr == null) { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized); } else { HttpContext.Current.User = new EzMovePrinicpal(new EzMoveIdentity(lr)); } } }
public Trip GetTripInfo(string TripID) { return(CacheImplementor.GetTrip(TripID)); }
public void UpdateLocation(string TripID, EZMoveCoordinates TripCoordinates, int LoginID) { CacheImplementor.UpdateTripLocation(TripID, TripCoordinates); //tripRepos.UpdateLocation(TripID, TripCoordinates, LoginID); }
public void StopTrip(string TripID, int LoginID) { CacheImplementor.UpdateTrip(TripID, EventDef.STOPTRIP); tripRepos.StopTrip(TripID, LoginID); MQManager.PushTripStatus(TripID, EventDef.STOPTRIP); }