Exemplo n.º 1
0
        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
                        ));
        }
Exemplo n.º 2
0
        public ActionResult BookingGeneral(
            Guid bookingId
            )
        {
            var bookingGeneralContract =
                new BookingGeneralContract(
                    bookingId,
                    Logging.UserId(User.Identity, ViewBag)
                    );

            // make view bag for ref codes
            List <CrudeBookingSourceRefContract> refs =
                new BusinessLogicLayer.CrudeBookingSourceRefServiceClient().FetchAll();

            ViewBag.BookingSourceRcd =
                new SelectList(refs,
                               "BookingSourceRcd",
                               "BookingSourceName",
                               bookingGeneralContract.BookingSourceRcd
                               );

            return(View(MVCHelper.Resolve(Request, "", "Booking", "BookingGeneral"),
                        bookingGeneralContract
                        ));
        }