Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra-prakash-tiwari committed Feb 25, 2020
1 parent 6a58af6 commit dcbaa84
Show file tree
Hide file tree
Showing 19 changed files with 491 additions and 275 deletions.
17 changes: 7 additions & 10 deletions CarPooling.Models/Booking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ public class Booking
{
public Guid Id { get; set; }

public Car Car { get; set; }
public Guid RequestedRide { get; set; }

public Journey Journey { get; set; }
public string SourceCityName { get; set; }

public User Owner { get; set; }
public string DestinationCityName { get; set; }

public BookingStatus Status { get; set; }
public int Pincode { get; set; }

public UserType Type { get; set; }
public string LandMark { get; set; }

public List<User> Traveller { get; set; }
public BookingStatus Status { get; set; }

public Booking()
{
Traveller = new List<User>();
}
public DateTime Date { get; set; }
}
}
1 change: 0 additions & 1 deletion CarPooling.Models/Car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ public class Car
public int MaxSeatCapacity { get; set; }

public int VacantSeat { get; set; }

}
}
4 changes: 2 additions & 2 deletions CarPooling.Models/CarPooling.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<Compile Include="Car.cs" />
<Compile Include="Constant.cs" />
<Compile Include="Enum.cs" />
<Compile Include="Journey.cs" />
<Compile Include="Login.cs" />
<Compile Include="Ride.cs" />
<Compile Include="Rating.cs" />
<Compile Include="User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViaPoint.cs" />
<Compile Include="Places.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
2 changes: 1 addition & 1 deletion CarPooling.Models/CarPooling.Models.csproj.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
74 changes: 40 additions & 34 deletions CarPooling.Models/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,90 +8,96 @@ namespace CarPooling.Models
{
public class Constant
{
public static readonly string MainMenu = "1. Login\n2. Signup\n3. Exit";
public static readonly string MainMenuOption = "1. Login\n2. Signup\n3. Exit";

public static readonly string UserMainMenu = "1. Create Ride Offer\n2. Book Ride Offer\n3. View Booking Status\n4. Modify Offer\n5. Delete Ride Offer\n6. Update Details\n7. Delete Account\n8. SignOut\n9. Exit";
public static readonly string UserMainMenuOption = "1. Create ride \n2. Book a ride \n3. View requested status\n4. Modify ride detail\n5. Delete ride\n6. Update account detail\n7. Delete account\n8. SignOut\n9. Exit";

public static readonly string StatusMenu = "1. Ride Offer\n2. Ride Request\n3. View Ride Detail\n4. SignOut\n5. Exit";
public static readonly string CheckRequestStatusOption = "1. Ride request\n2. booking request\n3. View booking Detail\n4. SignOut\n5. Exit";

public static readonly string UpdateUserDetailMenu = "1. Name\n2. MobileNumber\n3. EmailAddress\n4. Address\n5. DrivingLicence\n6. IdProofNumber\n7. Signout\n8. Exit";
public static readonly string UpdateUserDetailOption = "1. Name\n2. Mobile number\n3. Email address\n4. Address\n5. Driving licence\n6. Id proof number\n7. Signout\n8. Exit";

public static readonly string RequestChoice = "Press 1. Confirm\n 2. Rejected\n 3. Waiting";
public static readonly string RideRequestChoice = "Press 1. Confirm\n 2. Rejected\n 3. Waiting";

public static readonly string RideChoice = "Press 1. Yes\n 2. No";
public static readonly string BookingChoice = "Press 1. Yes\n 2. No";

public static readonly string ViewAnotherOffer = "Press 1. Yes\n 2. No";

public static readonly string ConfirmOption = "Press 1 for confirm this ";
public static readonly string ConfirmOption = "Press 1 for confirm this offer";

public static readonly string UpdateDetail = "Your Detail has been updated";
public static readonly string UpdateDetailResponse = "Your detail has been updated";

public static readonly string DeleteAccount = "You Account has been deleted";
public static readonly string AccountDeleteResponse = "You account has been deleted";

public static readonly string VacantSeatNotCorrect = "Vacant seat is less or equal to max capacity";
public static readonly string Confirmation = "Press 1. Yes\n 2. No";

public static readonly string InvalidUserIdOrPassword = "Press correct user Id or password";
public static readonly string InvalidVacantSeat = "Vacant seat is less or equal to max capacity";

public static readonly string InvalidBooking = "You can't book this booking right now";
public static readonly string InvalidUserIdPassword = "Press correct user Id or password";

public static readonly string RequestSentToOwner = "Request has been sent to Owner if he/she approve then enjoy your Ride";
public static readonly string InvalidBookingRequest = "You can not book this ride offer";

public static readonly string NoOfferForThisRoute = "No any offer available for this route";
public static readonly string RequestSentToOwner = "Request has been sent to owner if he/she approve then enjoy your Ride";

public static readonly string SeatFullMessage = "Seat full on this car better for next time";
public static readonly string NoRideOffer = "No any ride available for this route";

public static readonly string SeatBookSuccessfull = "Seat has been successfully booked thanks for confirming";
public static readonly string SeatFull = "Seat full for these ride offer";

public static readonly string NoRequestCurrently = "No request currently present";
public static readonly string SeatBookResponse = "Seat has been successfully booked thanks for confirming";

public static readonly string InvalidValue = "Please Enter Correct Value";
public static readonly string NoRequestCurrently = "No request currently available for this route";

public static readonly string InValidDate = "Please Enter Correct Date";
public static readonly string InvalidValue = "Please enter correct value";

public static readonly string UserId = "User Id : ";
public static readonly string InValidDate = "Please enter correct date";

public static readonly string City = "City : ";

public static readonly string UserId = "User id : ";

public static readonly string Password = "Password : ";

public static readonly string Name = "Name : ";

public static readonly string EmailAddress = "Email Address : ";
public static readonly string Email = "Email : ";

public static readonly string Address = "Address : ";

public static readonly string MobileNumber = "Mobile Number : ";
public static readonly string MobileNumber = "Mobile number : ";

public static readonly string DrivingLicenceNumber = "Driving Licence Number : ";
public static readonly string DrivingLicenceNumber = "Driving licence number : ";

public static readonly string IdProofNumber = "Id Proof Number : ";
public static readonly string IdProofNumber = "Id proof number : ";

public static readonly string CarDetail = "Car Detail ";
public static readonly string CarDetail = "Car detail ";

public static readonly string CarNumber = "Number : ";

public static readonly string CarModel = "Model Number :";
public static readonly string CarModel = "Model number :";

public static readonly string CarCapacity = "Max Capacity : ";
public static readonly string CarCapacity = "Max capacity : ";

public static readonly string VacantSeat = "Vacant Seat : ";
public static readonly string VacantSeat = "Vacant seat : ";

public static readonly string JourneyDetail = "Journey Detail : ";
public static readonly string JourneyDetail = "Journey detail : ";

public static readonly string Pincode = "Pincode : ";

public static readonly string Begining = "Starting Location : ";
public static readonly string Source = "Source location : ";

public static readonly string Ending = "End Location : ";
public static readonly string Destination = "Destination location : ";

public static readonly string Date = "Date : ";

public static readonly string LandMark = "LandMark : ";

public static readonly string PassangerCount = "No of passanger : ";

public static readonly string DisplayConfirmBooking = "Your Booking has been Confirmed Please contact once with Owner for more Detail";
public static readonly string DisplayConfirmBooking = "Your booking has been confirmed please contact once with owner for more detail";

public static readonly string DisplayRejectBooking = "Requestd booking has been rejected by the owner";

public static readonly string DisplayRejectBooking = "Requestd Booking has been Rejected by the Owner";
public static readonly string DisplayWaitingBooking = "Waiting for owner response";

public static readonly string DisplayWaitingBooking = "Waiting for Owner Response";
public static readonly string NoOfViaPlaces = "No of via place : ";
}
}
18 changes: 9 additions & 9 deletions CarPooling.Models/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ public enum MainMenuOption

public enum UserMainMenuOption
{
CreateRideOffer=1,
BookRideOffer,
ViewBookingStatus,
ModifyOffer,
DeleteRideOffer,
UpdateDetails,
DeleteAccount,
CreateRide=1,
BookARide,
ViewStatus,
ModifyRide,
DeleteRide,
UpdateAccountDetail,
DeleteUserAccount,
SignOut,
Exit
};

public enum BookinStatusMenuOPtion
public enum BookingStatusMenuOption
{
RideOffer=1,
RideRequest,
Expand All @@ -49,7 +49,7 @@ public enum UpdateUserDetailMenuOPtion
Exit
};

public enum RideOption
public enum ConfirmationResponse
{
Yes=1,
No
Expand Down
24 changes: 0 additions & 24 deletions CarPooling.Models/Journey.cs

This file was deleted.

4 changes: 2 additions & 2 deletions CarPooling.Models/ViaPoint.cs → CarPooling.Models/Places.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

namespace CarPooling.Models
{
public class ViaPoint
public class Places
{
public string City { get; set; }

public string Pincode { get; set; }
public int Pincode { get; set; }

public string LandMark { get; set; }
}
Expand Down
40 changes: 40 additions & 0 deletions CarPooling.Models/Ride.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CarPooling.Models
{
public class Ride
{
public Guid Id { get; set; }

public string SourceCityName { get; set; }

public string DestinationCityName { get; set; }

public int Pincode { get; set; }

public string LandMark { get; set; }

public DateTime Date { get; set; }

public Car Car { get; set; }

public List<Places> Points { get; set; }

public List<Guid> RequestBookerId { get; set; }

public List<Guid> AcceptedBookerId { get; set; }

public Ride()
{
RequestBookerId = new List<Guid>();

AcceptedBookerId = new List<Guid>();

Points = new List<Places>();
}
}
}
12 changes: 6 additions & 6 deletions CarPooling.Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ public class User

public string MobileNumber { get; set; }

public string EmailAddress { get; set; }
public string Email { get; set; }

public string Address { get; set; }

public string DrivingLicence { get; set; }

public string IdProofNumber { get; set; }

public List<Booking> Bookings { get; set; }
public List<Ride> Rides { get; set; }

public List<Booking> PastBookings { get; set; }
public List<Booking> Bookings { get; set; }

public List<Rating> Ratings { get; set; }

public User()
{
Bookings = new List<Booking>();
Ratings = new List<Rating>();

PastBookings = new List<Booking>();
Rides = new List<Ride>();

Ratings = new List<Rating>();
Bookings = new List<Booking>();
}
}
}
5 changes: 5 additions & 0 deletions CarPooling.Services/AppDataServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ public static User GetUser(string userId)
{
return Users.FirstOrDefault(a => a.Id == userId);
}

public static Booking GetBooking(Guid id)
{
return Users.SelectMany(a => a.Bookings).FirstOrDefault(a => a.Id == id);
}
}
}
Loading

0 comments on commit dcbaa84

Please sign in to comment.