public ActionResult BookingCreate() { // default values var bookingService = new BookingServiceClient(); BookingContract bookingContract = bookingService.GetBookingEmpty(Logging.UserId(User.Identity, ViewBag)); // todo, session id can't be trusted bookingContract.Booking.BookingId = new Guid(Session["SessionID"].ToString()); bookingContract.Booking.BookingSourceRcd = BookingSourceRef.InternalSystem; bookingContract.BookingIdentifier = new CrudeBookingIdentifierContract(); bookingContract.BookingIdentifier.BookingIdentifierTypeRcd = BookingIdentifierTypeRef.RecordLocator; bookingContract.BookingIdentifier.BookingIdentifierValue = new BookingServiceClient().LocatorCreate(); // get user id ViewBag.UserId = Logging.UserId(User.Identity, ViewBag); // refs List <CrudeBookingSourceRefContract> refs = new BusinessLogicLayer.CrudeBookingSourceRefServiceClient().FetchAll(); ViewBag.BookingSourceRcd = new SelectList( refs, "BookingSourceRcd", "BookingSourceName", bookingContract.Booking.BookingSourceRcd ); return(View(MVCHelper.Resolve(Request, "", "Booking", "BookingCreate"), bookingContract )); }
public void ShowAsAdd( Guid userId ) { _userId = userId; var bookingService = new BookingServiceClient(); _bookingContract = bookingService.GetBookingEmpty(userId); _bookingContract.BookingIdentifier = new CrudeBookingIdentifierContract(); _bookingContract.BookingIdentifier.BookingIdentifierValue = new BookingServiceClient().LocatorCreate(); _bookingContract.Booking.BookingSourceRcd = BookingSourceRef.InternalSystem; _bookingContract.BookingPassengers = new List <BookingPassengersContract>(); RefreshBooking(); Show(); }