private void InitializePageView(ReservationListModel model) { //if ((BXGOwner.User[0] != null)) //{ // model.IsSamplerOwner = BXGOwner.User[0].isSampler; // model.HomeProject = BXGOwner.User[0].HomeProject; //} //else //{ // model.IsSamplerOwner = false; // model.HomeProject = "0"; //} //if (model.IsSamplerOwner == true) // model.HidePanelChoice = true; // model.HidePaymentInfo = true; //if (Session["OwnerContractType"].ToString() == "Sampler") //{ // model.HideAccountInfo = true; // model.HideSavePointsButton = true; //} //if (Request.QueryString["display"] == null) // model.HidePanelReminder = true; }
private void HydrateModel(ReservationListModel model) { //PopulateReservationHistory(model); //PopulateAcctContractInfo(model); //GetMyPointsList(model); }
public ActionResult ReservationsLists() { BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"]; ReservationListModel myReservations = ReservationListMapper.Map(CurrentPage); myReservations = MasterMapper.Map(myReservations, CurrentPage); string reservationNo = String.Empty; string resortNo = String.Empty; if (TempData["ReservationNo"] != null && TempData["ResortNo"] != null) { reservationNo = TempData["ReservationNo"].ToString(); resortNo = TempData["ResortNo"].ToString(); } if (reservationNo != String.Empty && resortNo != String.Empty) { ReservationDetailModel detailsModel = new ReservationDetailModel(); detailsModel.ReservationNo = reservationNo; detailsModel.ResortNo = resortNo; myReservations.DetailModel = detailsModel; } ReservationListModel myreservation = new ReservationListModel(); PopulateAllReservations(myreservation); Response.Redirect(ConfigurationManager.AppSettings["bxgwebSitecoremyReservationRedirectUrl"], true); return(PartialView("ReservationsList", myreservation)); }
private void PopulateAllReservations(ReservationListModel model) { BGO.ResortsService.ReservationHistory history = new BGO.ResortsService.ReservationHistory(); BGO.ResortsService.ReservationHistoryList historyResult = new BGO.ResortsService.ReservationHistoryList(); BGO.ResortsService.ResortsServiceClient reservationAS400 = new BGO.ResortsService.ResortsServiceClient(); BGO.ResortsService.ReservationHistoryItem[] histories = null; BGO.ResortsService.OwnerID owner = new BGO.ResortsService.OwnerID(); try { history.OwnerID = null; owner.OwnerVacationNumber = BXGOwner.Arvact; history.OwnerID = owner; history.SiteName = BGO.ResortsService.Sites.OnlinePoints; history.EffectiveDate = DateTime.Now; history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Future; if (ViewData["myPendingHistoryBind"] == null) { historyResult = reservationAS400.GetReservationsHistory(history); if (historyResult.Success) { histories = historyResult.ReservationHistoryItem; model.PendingReservations = PopulateReservationsList(histories, BGO.ResortsService.ReservationHistoryType.Future); //ViewData["myPendingHistoryBind"] = histories; } } if (ViewData["myPastHistoryBind"] == null) { history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Past; historyResult = reservationAS400.GetReservationsHistory(history); if (historyResult.Success) { histories = historyResult.ReservationHistoryItem; model.PastReservations = PopulateReservationsList(histories, BGO.ResortsService.ReservationHistoryType.Past); //ViewData["myPastHistoryBind"] = histories; } } if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted) { reservationAS400.Close(); } } catch (Exception ex) { if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted) { reservationAS400.Close(); } StringBuilder errMsg = new StringBuilder(); errMsg.Append("Error happened fetching Reservations List"); errMsg.Append(ex.Message); sendMail.sendMessage("*****@*****.**", "", "Exception Error - Getting Reservation List", errMsg); } }
public async Task <ReservationListModel> SpecificUserReservations(string usr) { ReservationListModel reservations = new ReservationListModel(); using var cmd = this.Connection.CreateCommand(); cmd.CommandText = @"SELECT * FROM Reservations where username = @usr;"; cmd.Parameters.AddWithValue("@usr", usr); using (var reader = await cmd.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { var res = new ReservationModel() { reservationId = reader.GetInt32(0), username = reader.GetString(1), flightID = reader.GetInt32(2), accepted = reader.GetBoolean(3), agent = reader.GetString(4), numSeats = reader.GetInt32(5) }; reservations.ReservationList.Add(res); } } return(reservations); }
public ActionResult TransactionDetails(long reservationCode) { var model = new ReservationListModel { Reservations = DbAccess.GetReservationsByReservationCode(reservationCode), ReservationCode = reservationCode }; return(PartialView(model)); }
public ActionResult ReservationList() { if (Session["BXGOwner"] == null) { if (Session["_path_info"] != null) { Session["_path_info"] = Request.RawUrl; } Response.Redirect(ConfigurationManager.AppSettings["bxgwebUnsecureURL"] + "default.aspx?sess=timeout", true); } BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"]; ReservationListModel myReservations = ReservationListMapper.Map(CurrentPage); myReservations = MasterMapper.Map(myReservations, CurrentPage); HydrateModel(myReservations); string reservationNo = String.Empty; string resortNo = String.Empty; if (TempData["ReservationNo"] != null && TempData["ResortNo"] != null) { reservationNo = TempData["ReservationNo"].ToString(); resortNo = TempData["ResortNo"].ToString(); } if (reservationNo != String.Empty && resortNo != String.Empty) { ReservationDetailModel detailsModel = new ReservationDetailModel(); detailsModel.ReservationNo = reservationNo; detailsModel.ResortNo = resortNo; myReservations.DetailModel = detailsModel; } return(View(myReservations)); }
public async Task <ReservationListModel> GetReservations() { ReservationListModel reservation = new ReservationListModel(); using var cmd = this.Connection.CreateCommand(); cmd.CommandText = @"SELECT * FROM Reservations;"; using (var reader = await cmd.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { var res = new ReservationModel() { reservationId = reader.GetInt32(0), username = reader.GetString(1), flightID = reader.GetInt32(2), accepted = reader.GetBoolean(3), agent = reader.GetString(4), numSeats = reader.GetInt32(5) }; reservation.ReservationList.Add(res); } } return(reservation); }
public async Task <IActionResult> Reservations() { ReservationListModel reservations = await MySqlDatabase.GetReservations(); return(View(reservations)); }
public async Task <IActionResult> Reservations() { ReservationListModel reservations = await this.MySqlDatabase.SpecificUserReservations(airplane_ticketsystem.Controllers.HomeController.logined.username); return(View(reservations)); }
public ActionResult GetPartialView(ReservationListModel model) { return(PartialView("ReservationLists", model)); }