public ActionResult BookCar(string programId) { var prdId = Request.Form["productId"]; var sessionId = Request.Form["sessionId"]; var carPrograms = (SearchCarInfo)Session["SessionCarPrograms"]; var carProgram = new CarProgram(); if (carPrograms != null) { carProgram = carPrograms.RouteOptions.First().ProgramList.CarProgram.First(p => p.id == programId); } var bookCarRequest = new BookCarRequest { SelectedProgram = programId, recordLocatorId = 0, DriverInfo = new Driver() { age = 30, firstName = "FName", lastName = "LName" }, PaymentType = "Obligo", RequestedPrice = (decimal)carProgram.price, DeltaPrice = (decimal)(carProgram.price * 10 / 100), Currency = carProgram.currency }; var resultsInfo = new ResultsInfo(); CarServiceClient carSvc = new CarServiceClient(); var bookRespone = carSvc.BookCar(new LoginHeader { UserName = "******", Password = "******", Culture = "en-US", Version = "1" }, bookCarRequest, out resultsInfo); string fileLoc = @"C:\Temp\BookingHistory.txt"; System.IO.File.AppendAllText(fileLoc, (bookRespone.rgid + "," + bookRespone.Reservation.pickUpDate + "," + bookRespone.Reservation.toDate + "," + bookRespone.Reservation.status + ";")); return View(bookRespone); }
//[MultipleButton(Name = "action", Argument = "Tourico")] public ActionResult BookCar(string programId) { var prdId = Request.Form["productId"]; var sessionId = Request.Form["sessionId"]; var carPrograms = (SearchCarInfo)Session["SessionCarPrograms"]; var carProgram = new CarProgram(); if (carPrograms != null) { carProgram = carPrograms.RouteOptions.First().ProgramList.CarProgram.First(p => p.id == programId); } var bookCarRequest = new BookCarRequest { SelectedProgram = programId, recordLocatorId = 0, DriverInfo = new Driver() { age = 30, firstName = "FName", lastName = "LName" }, PaymentType = "Obligo", RequestedPrice = (decimal)carProgram.price, DeltaPrice = (decimal)(carProgram.price * 10 / 100), Currency = carProgram.currency }; var resultsInfo = new ResultsInfo(); CarServiceClient carSvc = new CarServiceClient(); var bookRespone = carSvc.BookCar(new LoginHeader { UserName = "******", Password = "******", Culture = "en-US", Version = "1" }, bookCarRequest, out resultsInfo); string fileLoc = @"C:\Temp\BookingHistory.txt"; System.IO.File.AppendAllText(fileLoc, (bookRespone.rgid + "," + bookRespone.Reservation.pickUpDate + "," + bookRespone.Reservation.toDate + "," + bookRespone.Reservation.status + ";")); return(View(bookRespone)); }