Beispiel #1
0
 /// <summary>
 /// Gets a single booking on the basis of Id and Type Passed.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="type">Pass type to filter bookings on the basis. Type - UserId, BookingId</param>
 /// <returns></returns>
 public static Booking GetBooking(int id, string type)
 {
     var post = new TMSDataLibrary.Post();
     var oBooking = new Booking();
     var dt = post.GetBooking(id, type);
     if (dt.Rows.Count > 0)
     {
         var row = dt.Rows[0];
         oBooking.BookingId = Convert.ToInt32(row["BookingId"]);
         oBooking.FromCityName = row["FromCityName"].ToString();
         oBooking.ToCityName = row["ToCityName"].ToString();
         oBooking.TransporterVehicle.RegistrationNo = row["RegistrationNo"].ToString();
         oBooking.SchdDate = Convert.ToDateTime(row["SchdDate"]);
         oBooking.TransporterVehicle.TransporterId = Convert.ToInt32(row["TransporterId"]);
         oBooking.TransporterVehicle.Transporter.TransportName = row["TransportName"].ToString();
         oBooking.TransporterVehicle.Transporter.FirstName = row["FirstName"].ToString();
         oBooking.TransporterVehicle.Transporter.LastName = row["LastName"].ToString();
         oBooking.TransporterVehicle.Transporter.Mobile = row["Mobile"].ToString();
     }
     return oBooking;
 }
Beispiel #2
0
 /// <summary>
 /// Gets a single booking on the basis of bookingNo
 /// </summary>
 /// <param name="bookingNo"></param>
 /// <returns></returns>
 public static DataTable GetBooking(string bookingNo)
 {
     var post = new TMSDataLibrary.Post();
     return post.GetBooking(bookingNo);
 }