예제 #1
0
        private string getDescription(NewRide i_ControlsData)
        {
            StringBuilder description = new StringBuilder();

            description.AppendLine($"Ride from {i_ControlsData.CityFrom} to {i_ControlsData.CityTo}");
            description.AppendLine($"at {i_ControlsData.RideDate}");

            if (i_ControlsData.IsUserDriver)
            {
                description.AppendLine($"{r_LoggedInUser.Name} will drive");
            }
            else
            {
                description.AppendLine($"{r_LoggedInUser.Name} looking for driver");
            }

            return(description.ToString());
        }
예제 #2
0
        private void handleNewRideSubmission()
        {
            try
            {
                NewRide   controlsData = fetchNewRidePanelConrolersData();
                RideGroup rideGroup    = m_UserGroupNameIDMapping[controlsData.GroupID];
                //Group chosenRideFBGroup = FacebookWrapper.FacebookService.GetObject(controlsData.GroupID);
                string eventName        = $"{r_LoggedInUser.Name} new Ride!";
                string eventDescription = getDescription(controlsData);
                Event  eventRide        = rideGroup.CreateEvent(r_LoggedInUser, eventName,
                                                                controlsData.RideDate,
                                                                i_Description: eventDescription);

                r_DBHandler.SaveEventToGroupRide(rideGroup.Id, eventRide.Id);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }