示例#1
0
        public ActionResult BookOnHold(String refCode, String buttonId)
        {
            ViewBag.RefCode  = refCode;
            ViewBag.ButtonId = buttonId;


            var pageVm = new PaymentConfirmaton();

            try
            {
                if (Session["transactionDetails"] != null && Session["BookingRequest"] != null)
                {
                }
                var tranDetals = (PostSearchResponseModel)Session["transactionDetails"];
                pageVm.BookingResponse = tranDetals.Object;
                pageVm.BookingRequest  = (PostSearchModel)Session["BookingRequest"];

                pageVm.BookingRequest.SeatNumber = pageVm.BookingRequest.SeatRegistrations.Split(':')[1];
            }
            catch (Exception ex)
            {
                bool IsReturnTrp = false;

                if ((int)Session["roundTripHire"] == 1)
                {
                    IsReturnTrp = true;
                }
                var hireRequestReturn = IsReturnTrp ? (GetHireRefcodeRequestReturn)Session["HireRequest"] : null;
                var hireRequest       = !IsReturnTrp ? (GetHireRefcodeRequest)Session["HireRequest"] : null;

                var tranDetails    = new PostSearchResponseModel.BookingResponse();
                var bookingRequest = new PostSearchModel();

                var hireResponse         = new getVehicleForHireResponse();
                var hireRefCodeAmountObj = new hireRefcodeAmount();

                var hirePageVm = new PaymentConfirmatonHire();


                hireResponse                    = (getVehicleForHireResponse)Session["HireResponse"];
                hireRefCodeAmountObj            = (hireRefcodeAmount)Session["HireResponse_"];
                hirePageVm.BookingRequestReturn = hireRequestReturn;
                hirePageVm.BookingRequest       = hireRequest;
                hirePageVm.BookingResponse      = hireResponse;
                hirePageVm.HirePayResponse      = hireRefCodeAmountObj;

                ViewBag.HireService = true;
                tranDetails.BookingReferenceCode = hireRefCodeAmountObj.RefCode;


                if (IsReturnTrp)
                {
                    tranDetails.Amount        = hireRequestReturn.Amount;
                    tranDetails.DepartureDate = hireRequestReturn.OnewayPickupDate;

                    bookingRequest.Amount        = hireRequestReturn.Amount.ToString();
                    bookingRequest.FirstName     = hireRequestReturn.FullName;
                    bookingRequest.Email         = hireRequestReturn.Email;
                    bookingRequest.PhoneNumber   = hireRequestReturn.PhoneNumber;
                    bookingRequest.PaymentMethod = Convert.ToInt32(hireRequestReturn.PaymentMethod);

                    pageVm.BookingRequest  = bookingRequest;
                    pageVm.BookingResponse = tranDetails;
                }
                else
                {
                    tranDetails.Amount        = hireRequest.Amount;
                    tranDetails.DepartureDate = hireRequest.OnewayPickupDate;

                    bookingRequest.Amount        = hireRequest.Amount.ToString();
                    bookingRequest.FirstName     = hireRequest.FullName;
                    bookingRequest.Email         = hireRequest.Email;
                    bookingRequest.PhoneNumber   = hireRequest.PhoneNumber;
                    bookingRequest.PaymentMethod = Convert.ToInt32(hireRequest.PaymentMethod);

                    pageVm.BookingRequest  = bookingRequest;
                    pageVm.BookingResponse = tranDetails;
                }


                Logical.WriteToLog(ex.Message);
            }



            return(View(pageVm));
        }
示例#2
0
        public ActionResult PaymentConfirmation()
        {
            //Hire Service
            if (Session["HireResponse_"] != null)
            {
                bool IsReturnTrp = false;


                if ((int)Session["roundTripHire"] == 1)
                {
                    IsReturnTrp = true;
                }
                var hireRequestReturn = IsReturnTrp ? (GetHireRefcodeRequestReturn)Session["HireRequest"] : null;
                var hireRequest       = !IsReturnTrp ? (GetHireRefcodeRequest)Session["HireRequest"] : null;

                var hireResponse         = new getVehicleForHireResponse();
                var hireRefCodeAmountObj = new hireRefcodeAmount();

                var hirePageVm = new PaymentConfirmatonHire();

                try
                {
                    hireResponse                    = (getVehicleForHireResponse)Session["HireResponse"];
                    hireRefCodeAmountObj            = (hireRefcodeAmount)Session["HireResponse_"];
                    hirePageVm.BookingRequestReturn = hireRequestReturn;
                    hirePageVm.BookingRequest       = hireRequest;
                    hirePageVm.BookingResponse      = hireResponse;
                    hirePageVm.HirePayResponse      = hireRefCodeAmountObj;

                    ViewBag.HireService = true;

                    var vhire = (getVehicleForHireResponse)Session["HireResponse"];


                    return(View(hirePageVm));
                }
                catch (Exception ex)
                {
                    Logical.WriteToLog(ex.Message);

                    return(View(hirePageVm));
                }
            }
            else
            {
                var bookingRequest = new PostSearchModel();
                var tranDetals     = new PostSearchResponseModel();
                tranDetals.Object = new PostSearchResponseModel.BookingResponse();

                String otherSeats = String.Empty;

                var pageVm = new PaymentConfirmaton();



                try
                {
                    tranDetals             = (PostSearchResponseModel)Session["transactionDetails"];
                    pageVm.BookingResponse = tranDetals.Object;
                    pageVm.BookingRequest  = (PostSearchModel)Session["BookingRequest"];


                    pageVm.BookingRequest.SeatNumber = pageVm.BookingRequest.SeatRegistrations.Split(':')[1];

                    int i = 0;
                    foreach (var item in pageVm.BookingRequest.Beneficiaries)
                    {
                        i++;
                        otherSeats += item.SeatNumber;

                        if (i < pageVm.BookingRequest.Beneficiaries.Count)
                        {
                            otherSeats += ":";
                        }
                    }

                    Session["OtherSeats"] = otherSeats;



                    // pageVm.BookingRequest.SeatRegistrations.Split
                }
                catch (Exception ex)
                {
                    Logical.WriteToLog(ex.Message + "::" + ex.StackTrace);

                    pageVm.BookingResponse = ((PostSearchResponseModel)Session["booking"]).Object;
                    pageVm.BookingRequest  = (PostSearchModel)Session["BookingRequest"];

                    int i = 0;
                    foreach (var item in pageVm.BookingRequest.Beneficiaries)
                    {
                        i++;
                        otherSeats += item.SeatNumber;

                        if (i < pageVm.BookingRequest.Beneficiaries.Count)
                        {
                            otherSeats += ":";
                        }
                    }
                }

                ViewBag.Status = true;
                return(View(pageVm));
            }
        }