public ActionResult Index(ExportModel Expmodel, IssuedTicketModel model, FormCollection frm, int?pageNo, int?flag) { var ts = (TravelSession)Session["TravelPortalSessionInfo"]; model.IssuedTicketList = ser.ListIssuedTicketReport(model.AgentId, model.FromDate, model.ToDate); //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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.IssuedTicketList.Select(m => new { Brach_Office = m.BranchOfficeName, Distributor = m.DistributorName, Agent_Name = m.AgentName, Passenger_Name = m.PassengerName, No_of_Pax = m.NoOfPax, Airline_Code = m.AirlineCode, Sector = m.Sector, GDS_PNR = m.GDSReferenceNumber, Flight_Date = m.FlightDate, Issued_On = m.IssuedOn, Issued_By = m.IssuedBy, Service_Provider = m.ServiceProviderName, Created_By = m.CreatedBy, }); App_Class.AppCollection.Export(Expmodel, exportData, "Issued Ticket"); } catch { } } ViewData["AirlineTypes"] = new SelectList(ser.GetAirlineTypesList(), "AirineTypeId", "TypeName"); ViewData["AgentList"] = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName"); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, PurchaseSalesReportModel model, FormCollection frm) { model.PurchaseList = PurchaseSalesReportRepository.GetPurchaseList(model.CurrencyID, model.FromDate, model.ToDate); BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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; } int count = 1; var exportData = model.PurchaseList.Select(m => new { SN = count++, Branch_Name = m.BranchName, Distributor_Name = m.DistributorName, Agent_Name = m.AgentName, Service_Provider = m.ServiceProvider, Airline = m.Ariline, Sector = m.Sector, Admin_Purchase = m.AdminPurchase, Admin_Sales = m.AdminSales, Branch_Purchase = m.BranchPurchase, Branch_Sales = m.BranchSales, Distributor_Purchase = m.DistributorPurchase, Distributor_Sales = m.DistributorSales, Agent_Purchase = m.AgentPurchase, Agent_Sales = m.AgentSales }); App_Class.AppCollection.Export(Expmodel, exportData, "Purchase Sales Report"); } catch { } } model.CurrencyList = PurchaseSalesReportRepository.GetCurrency(); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, GDSHitsModel model, FormCollection frm) { model.GDSHitLists = pro.GetGDSHitCount(model.FromDate, model.ToDate, model.hdfAgentId); //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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 = new List <TransactionHitsExportModel>(); foreach (var item in model.GDSHitLists) { var rpt = new TransactionHitsExportModel(); rpt.GDSHitsCount = item.GDSHitCount; rpt.TransactionName = item.TransactionName; exportData.Add(rpt); } App_Class.AppCollection.Export(Expmodel, exportData, "Transaction_Hits"); } catch { } } return(View(model)); }
public ActionResult Index(ExportModel Expmodel, IssuedTicketModel model, FormCollection frm, int?pageNo, int?flag) { var ts = SessionStore.GetTravelSession(); var agentsByBranchOffice = branchOfficeManagementProvider.GetAllAgentsByBranchOfficeId(ts.LoginTypeId); ATLTravelPortal.Areas.Administrator.Repository.DistributorManagementProvider distributorManagentProvider = new ATLTravelPortal.Areas.Administrator.Repository.DistributorManagementProvider(); var details = ser.ListIssuedTicketReport(null, model.FromDate, model.ToDate); if (model.AgentId != null) { //int appUserId = branchOfficeManagementProvider.GetAppUserIdByDistributorId(model.AgentId.Value); //var agentsByDistributor = distributorManagentProvider.GetAllAgentsByDistributorId(appUserId); //var result = agentsByDistributor.SelectMany(b => details.Where(x => x.AgentId == b.AgentId).ToList()); //model.IssuedTicketList = result; var result = details.Where(x => x.DistributorId == model.AgentId); model.IssuedTicketList = result; } else { //var result = agentsByBranchOffice.SelectMany(b => details.Where(x => x.AgentId == b.AgentId).ToList()); //model.IssuedTicketList = result; var result = details.Where(x => x.BracnOfficeId == ts.LoginTypeId); model.IssuedTicketList = result; } //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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.IssuedTicketList.Select(m => new { Agent_Name = m.AgentName, Passenger_Name = m.PassengerName, No_Of_Pax = m.NoOfPax, Airline_Code = m.AirlineCode, Sector = m.Sector, GDS_PNR = m.GDSReferenceNumber, Flight_Date = m.FlightDate, Issued_On = m.IssuedOn, Issued_By = m.IssuedBy, Service_Provider = m.ServiceProviderName, Created_By = m.CreatedBy, }); App_Class.AppCollection.Export(Expmodel, exportData, "Issued Ticket"); } catch { } } ViewData["AirlineTypes"] = new SelectList(ser.GetAirlineTypesList(), "AirineTypeId", "TypeName"); ViewData["AgentList"] = new SelectList(defaultProvider.GetDistributorList(ts.LoginTypeId), "DistributorId", "DistributorName"); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, SegmentCountReportModel model, FormCollection frm, int?page) { int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 30; model.SegmentCountReportList = ser.ListSegmentCountReport(model.YearId, model.ServiceProviderId, model.hdfAgentId).ToPagedList(currentPageIndex, defaultPageSize); //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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 = new List <SegmentCountReportExportModel>(); foreach (var item in model.SegmentCountReportList) { var rpt = new SegmentCountReportExportModel(); rpt.Info = item.Info; rpt.Jan = item.Jan; rpt.Feb = item.Feb; rpt.March = item.Mar; rpt.April = item.April; rpt.May = item.May; rpt.Jun = item.Jun; rpt.July = item.July; rpt.Aug = item.Aug; rpt.Sep = item.Sep; rpt.Oct = item.Oct; rpt.Nov = item.Nov; rpt.Dec = item.Dec; exportData.Add(rpt); } App_Class.AppCollection.Export(Expmodel, exportData, "SegmentCount"); } catch { } } return(View(model)); }