Ejemplo n.º 1
0
        public LoginResponse LoginUser(Login user)
        {
            LoginResponse lr = loginRepos.LoginUser(user);

            if (lr != null)  //Update Cache
            {
                CacheImplementor.UpdateUser(lr);
            }
            return(lr);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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));
                }
            }
        }
Ejemplo n.º 4
0
        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));
                }
            }
        }
Ejemplo n.º 5
0
 public Trip GetTripInfo(string TripID)
 {
     return(CacheImplementor.GetTrip(TripID));
 }
Ejemplo n.º 6
0
 public void UpdateLocation(string TripID, EZMoveCoordinates TripCoordinates, int LoginID)
 {
     CacheImplementor.UpdateTripLocation(TripID, TripCoordinates);
     //tripRepos.UpdateLocation(TripID, TripCoordinates, LoginID);
 }
Ejemplo n.º 7
0
 public void StopTrip(string TripID, int LoginID)
 {
     CacheImplementor.UpdateTrip(TripID, EventDef.STOPTRIP);
     tripRepos.StopTrip(TripID, LoginID);
     MQManager.PushTripStatus(TripID, EventDef.STOPTRIP);
 }