public ActionResult Index(int?page, DateTime?FromDate, DateTime?ToDate) { var ts = SessionStore.GetTravelSession(); //var agents = ser.GetAgentsList().Where(x => x.CreatedBy == ts.AppUserId); var agents = ser.GetAgentsList().Where(x => x.DistributorId == ts.LoginTypeId); ViewData["Agents"] = new SelectList(agents, "AgentId", "AgentName"); int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 30; PendingBookingModel model = new PendingBookingModel(); if (FromDate == null && ToDate == null) { model.FromDate = GeneralRepository.CurrentDateTime().AddDays(-15); model.ToDate = GeneralRepository.CurrentDateTime(); } else { model.FromDate = FromDate; model.ToDate = ToDate; } //var agentsByDistributor = distributorManagementProvider.GetAllAgentsByDistributorId(ts.AppUserId); //var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); //var result = agentsByDistributor.SelectMany(b => details.Where(x => x.AgentId == b.AgentId).ToList()); var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); var result = details.Where(x => x.DistributorId == ts.LoginTypeId); model.PendingBookingList = result.ToPagedList(currentPageIndex, defaultPageSize); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, PendingBookingModel model, FormCollection frm, int?page) { int defaultPageSize = 30; int currentPageIndex = page.HasValue ? page.Value : 1; // model.PendingBookingList model.PendingBookingList = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate).ToPagedList(currentPageIndex, defaultPageSize); //export bkt.GetExportTypeClicked(Expmodel, frm); if (Expmodel != null && (Expmodel.ExportTypeExcel != null || Expmodel.ExportTypeWord != null || Expmodel.ExportTypeCSV != null || Expmodel.ExportTypePdf != null)) { try { if (Expmodel.ExportTypeExcel != null) { Expmodel.ExportTypeExcel = Expmodel.ExportTypeExcel; } else if (Expmodel.ExportTypeWord != null) { Expmodel.ExportTypeWord = Expmodel.ExportTypeWord; } else if (Expmodel.ExportTypePdf != null) { Expmodel.ExportTypePdf = Expmodel.ExportTypePdf; } var exportData = model.PendingBookingList.Select(m => new { Brach_Office = m.BranchOfficeName, Distributor = m.DistributorName, Agent = m.AgentName, Passenger_Name = m.PassegerName, Sector = m.Sector, GDS_PNR = m.GDSReferenceNumber, Flight_Date = m.FlightDate, Booked_On = TimeFormat.DateFormat(m.BookedOn.ToString()), Booked_by = m.BookedBy }); App_Class.AppCollection.Export(Expmodel, exportData, "PendingBooking "); } catch (Exception ex) { ATLTravelPortal.Utility.ErrorLogging.LogException(ex); TempData["ActionResponse"] = ex.Message; } } ViewData["Agents"] = new SelectList(ser.GetAgentsList(), "AgentId", "AgentName"); return(View(model)); }
public List <PendingBookingModel> ListPendingBookintReport(int?AgentId, DateTime?fromdate, DateTime?todate) { var data = ent.Air_GetPendingTicket(AgentId, fromdate, todate); List <PendingBookingModel> model = new List <PendingBookingModel>(); foreach (var item in data.Select(x => x)) { var PendingBookingModel = new PendingBookingModel { PNRId = item.PNRId, AgentName = item.AgentName, GDSReferenceNumber = item.GDSRefrenceNumber, PassegerName = item.PassengerName, Sector = item.Sector, BookedOn = (DateTime)item.BookedOn, BookedBy = item.BookedBy, ServiceProviderName = item.ServiceProviderName, FlightDate = item.FlightDate, // ServiceProviderReferenceNumber = item.ServiceProviderName == "TBO" ? "/IndianLCC/LccPNRDetail" : "/Airline/PNRDetail", AgentId = item.AgentId, BrachOfficeId = item.BranchOfficeId, DistributorId = item.DistributorId, AgentCode = new ATLTravelPortal.Areas.Airline.Repository.BookedTicketReportProvider().GetAgentCodeById(item.AgentId) }; var distributor = distributorManagementProvider.GetDistributorByDistributorId(item.DistributorId); if (distributor != null) { PendingBookingModel.DistributorName = distributor.DistributorName + "(" + distributor.DistributorCode + ")"; } var branchOffice = branchOfficeManagementProvider.GetBranchOfficeInfo(item.BranchOfficeId); if (branchOffice != null) { PendingBookingModel.BranchOfficeName = branchOffice.BranchOfficeName + "(" + branchOffice.BranchOfficeCode + ")"; } model.Add(PendingBookingModel); } return(model.ToList()); }
public ActionResult Index(int?page, DateTime?FromDate, DateTime?ToDate) { ViewData["Agents"] = new SelectList(ser.GetAgentsList(), "AgentId", "AgentName"); int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 30; PendingBookingModel model = new PendingBookingModel(); if (FromDate == null && ToDate == null) { model.FromDate = GeneralRepository.CurrentDateTime().AddDays(-15); model.ToDate = GeneralRepository.CurrentDateTime(); } else { model.FromDate = FromDate; model.ToDate = ToDate; } model.PendingBookingList = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate).ToPagedList(currentPageIndex, defaultPageSize); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, PendingBookingModel model, FormCollection frm, int?page) { int defaultPageSize = 30; int currentPageIndex = page.HasValue ? page.Value : 1; var ts = SessionStore.GetTravelSession(); //var agentsByDistributor = distributorManagementProvider.GetAllAgentsByDistributorId(ts.AppUserId); //var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); //var result = agentsByDistributor.SelectMany(b => details.Where(x => x.AgentId == b.AgentId).ToList()); var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); var result = details.Where(x => x.DistributorId == ts.LoginTypeId); model.PendingBookingList = result.ToPagedList(currentPageIndex, defaultPageSize); //export bkt.GetExportTypeClicked(Expmodel, frm); if (Expmodel != null && (Expmodel.ExportTypeExcel != null || Expmodel.ExportTypeWord != null || Expmodel.ExportTypeCSV != null || Expmodel.ExportTypePdf != null)) { try { if (Expmodel.ExportTypeExcel != null) { Expmodel.ExportTypeExcel = Expmodel.ExportTypeExcel; } else if (Expmodel.ExportTypeWord != null) { Expmodel.ExportTypeWord = Expmodel.ExportTypeWord; } else if (Expmodel.ExportTypePdf != null) { Expmodel.ExportTypePdf = Expmodel.ExportTypePdf; } var exportData = model.PendingBookingList.Select(m => new { Agent = m.AgentName, Passenger_Name = m.PassegerName, Sector = m.Sector, GDS_PNR = m.GDSReferenceNumber, Flight_Date = m.FlightDate, Booked_On = TimeFormat.DateFormat(m.BookedOn.ToString()), Booked_by = m.BookedBy }); App_Class.AppCollection.Export(Expmodel, exportData, "PendingBooking "); } catch (Exception ex) { ATLTravelPortal.Utility.ErrorLogging.LogException(ex); TempData["ActionResponse"] = ex.Message; } } //var agents = ser.GetAgentsList().Where(x => x.CreatedBy == ts.AppUserId); var agents = ser.GetAgentsList().Where(x => x.DistributorId == ts.LoginTypeId); ViewData["Agents"] = new SelectList(agents, "AgentId", "AgentName"); return(View(model)); }