Esempio n. 1
0
 public void AddRider(Rider rider)
 {
     rider.Salt          = Auth.GenerateSalt();
     rider.Password      = Auth.Hash(rider.Password, rider.Salt);
     rider.LastLatitude  = "";
     rider.LastLongitude = "";
     rider.ActiveRide    = -1;
     rider.LastRide      = -1;
     rider.Role          = "User";
     _context.Add(rider);
     _context.SaveChanges();
 }
Esempio n. 2
0
        public Ride AddRide(RidesRequestData RequestData)
        {
            Ride ride = new Ride();

            ride.RideName    = RequestData.RideName;
            ride.Description = RequestData.Description;
            ride.Distance    = RequestData.Distance;
            ride.StartDate   = RequestData.RideStart;
            ride.CreatorId   = RequestData.RiderId;
            _context.Add(ride);
            _context.SaveChanges();
            return(ride);
        }
        public Follow AddFollow(FollowRequestData RequestData)
        {
            Follow f = new Follow();

            f.FollowingID = RequestData.FollowingId;
            f.FollowerID  = RequestData.FollowerId;
            f.FollowState = FollowStateType.FollowRequested;

            // Set up  the actual follow data
            //f.FollowerRider = _riderService.GetRiderByID(f.FollowerID);
            //f.FollowingRider = _riderService.GetRiderByID(f.FollowingID);
            _context.Add(f);
            _context.SaveChanges();
            return(f);
        }
        public Signup AddSignup(SignupRequestData signupRequest)
        {
            Signup signup = new Signup();

            signup.RiderID = signupRequest.RiderId;
            signup.RideID  = signupRequest.RideId;
            _context.Add(signup);
            _context.SaveChanges();
            return(signup);
        }