コード例 #1
0
        public ActionResult Index(BusPNRModel model, int?page, ExportModel Expmodel, FormCollection frm)
        {
            Session["FromDate"] = model.FromDate;
            Session["ToDate"]   = model.ToDate;
            BusPNRModel _model            = new BusPNRModel();
            UnIssuedTicketRepository _rep = new UnIssuedTicketRepository();

            BusGeneralRepository.SetRequestPageRow();
            try
            {
                var ts = (TravelSession)Session["TravelPortalSessionInfo"];
                ViewData["AgentList"] = new SelectList(defaultProvider.GetDistributorAgentList(ts.LoginTypeId), "AgentId", "AgentName");
                _model.TabularList    = _rep.GetDistributorPagedIssueList(page, model.FromDate, model.ToDate, model.AgentId, ts.LoginTypeId);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }

            //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.TabularList.Select(m => new
                    {
                        Passenger_Name = m.FullName,
                        Operator_Name  = m.BusMasterName,
                        DepartureDate  = TimeFormat.DateFormat(m.DepartureDate.ToString()),
                        DepartureTime  = TimeFormat.GetAMPMTimeFormat(m.DepartureTime.ToString()),
                        Category       = m.BusCategoryName,
                        Type           = m.Type
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "Issued Ticket");
                }
                catch
                {
                }
            }

            _model.Message = _res;
            return(View(_model));
        }
コード例 #2
0
        public ActionResult Edit(int Id)
        {
            MakePaymentModel model = new MakePaymentModel();

            model = ser.GetMakePaymentDetail(Id);
            model.CashGivenToDate  = TimeFormat.DateFormat(model.CashGivenToDepositDate.ToString());
            model.ChequeDate       = TimeFormat.DateFormat(model.ChequeIssueDate.ToString());
            model.DraftDate        = TimeFormat.DateFormat(model.DraftDepositDate.ToString());
            model.CashDate         = TimeFormat.DateFormat(model.CashDepositDate.ToString());
            model.BankTransferDate = TimeFormat.DateFormat(model.BankTransferDepositDate.ToString());
            model.RTGSDate         = TimeFormat.DateFormat(model.RTGSDepositDate.ToString());

            ViewData["Bank"]              = new SelectList(ser.AllBank(), "BankId", "BankName");
            ViewData["BankBranch"]        = new SelectList(ser.AllBankBranch(model.BankId), "BankBranchId", "BranchName");
            ViewData["ChequeDrawnOnBank"] = new SelectList(ser.GetBank(), "BankId", "BankName");


            model.ChequeCurrencyList       = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.DraftCurrencyList        = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.CashCurrencyList         = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.BankTransferCurrencyList = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.RTGSCurrencyList         = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.CashGivenToCurrencyList  = new SelectList(ser.GetCurrenciesList(), "Value", "Text");

            model.SalesAgentList = ser.GetAllGetSalesAgentList();
            model.AgentList      = new CreditLimitProvider().GetAllAgentList();
            return(View(model));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public ActionResult Index(ExportModel Expmodel, PNRReportModel model, FormCollection frm)
        {
            var ts = (TravelSession)Session["TravelPortalSessionInfo"];


            _modObj.PNRReportList = _provider.GetAirRetrievePNRInfoList(model);


            //export
            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 = _modObj.PNRReportList.Select(m => new
                    {
                        Booked_Date    = TimeFormat.DateFormat(m.CreatedDate.ToString()),
                        GDS_PNR        = m.GDSRefrenceNumber,
                        Airlines_PNR   = m.ServiceProviderName,
                        Airline        = m.AirlineCode,
                        Sector         = m.Sector,
                        Class          = m.Class,
                        Fare           = m.BaseFare,
                        Tax            = m.TotalTax,
                        Comm           = m.CommissionOnBF,
                        Service_Charge = m.ServiceCharge,
                        Total_Fare     = m.TotalFare,
                        Status         = m.ticketStatusName
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "RetrievePNR");
                }
                catch
                {
                }
            }

            GetViewModelList(_modObj);
            return(View(_modObj));
        }
コード例 #5
0
        public ActionResult Index(ExportModel Expmodel, AgentReportModel model, FormCollection frm, int?page)
        {
            int currentPageIndex = 1;       //page.HasValue ? page.Value : 1;
            int defaultPageSize  = 1000000; //30;

            model.AgentDetailList = ser.GetAgentInfo().ToPagedList(currentPageIndex, defaultPageSize);

            //export
            BookedTicket.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.AgentDetailList.Select(m => new
                    {
                        Branch_Name      = m.BranchName,
                        Distributor_Name = m.DistributorName,
                        Agent_Name       = m.AgentName,
                        Agent_Code       = m.AgentCode,
                        MEs_Name         = m.MEsName,
                        Address          = m.Address,
                        Email            = m.Email,
                        Phone            = m.Phone,
                        Mobile           = m.mobile,
                        Zone_Name        = m.zonename,
                        District_Name    = m.districtname,
                        Signup_By        = m.signupby,
                        Signup_Date      = TimeFormat.DateFormat(m.SignupDate.ToString()),
                        Reg_By           = m.Type == -1 ? "Admin" : "Self"
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "Agent Information");
                }
                catch
                {
                }
            }

            return(View(model));
        }
コード例 #6
0
        public ActionResult Index(ExportModel Expmodel, SectorSalesModel model, FormCollection frm, int?pageNo, int?flag)
        {
            model.SectorSalesList = ser.SectorSalesList(model.FromDate, model.ToDate, model.CurrencyId);

            //export

            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.SectorSalesList.Select(m => new
                    {
                        MPNRId             = m.MPNRId,
                        GDS_Ref            = m.GDSReferenceNumber,
                        Service_Provider   = m.ServiceProviderName,
                        Airline            = m.AirlineCode,
                        Sector             = m.Sector,
                        Class              = m.Class,
                        Ticket_Number      = m.TicketNumber,
                        Admin_Amount       = m.AdminAmount,
                        Agent_Amount       = m.AgentAmount,
                        Branch_Amount      = m.BranchAmount,
                        Distributor_Amount = m.DistributorAmount,
                        Booked_Date        = TimeFormat.DateFormat(m.CreatedDate.ToString()),
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "SectorSales ");
                }
                catch
                {
                }
            }

            ViewData["Currencies"] = new SelectList(ser.GetCurrenciesList(), "CurrencyId", "CurrencyCode");

            return(View(model));
        }
コード例 #7
0
        public ActionResult Index(ExportModel Expmodel, TopUpModel model, FormCollection frm)
        {
            model.ddlServiceProviderList = ser.ddlServiceProviderList();
            model.ddlTypeList            = ser.ddlTypeList();
            model.ddlStatusList          = ser.ddlStatusList();
            model.ListTopUp = ser.List(model);


            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.ListTopUp.Select(m => new
                    {
                        Tran_Id   = m.SalesTranId,
                        Date      = TimeFormat.DateFormat(m.SalesDate.ToString()),
                        Mobile_No = m.MobileNo,
                        Amount    = m.RechargeAmount,
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "Mobile TopUp ");
                }
                catch
                {
                }
            }


            return(View(model));
        }
コード例 #8
0
        public ActionResult Index(ExportModel Expmodel, B2CUserManagementModel model, FormCollection frm)
        {
            model.ListB2CUsers = ser.GetAllB2CUserList().ToPagedList(1, int.MaxValue);
            //export
            bktctrl.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.ListB2CUsers.Select(m => new
                    {
                        Name         = m.FullName,
                        User_Name    = m.UserName,
                        Email        = m.Email,
                        Address      = m.Address,
                        Mobile       = m.Mobile,
                        Phone        = m.Phone,
                        Created_Date = TimeFormat.DateFormat(m.CreatedDate.ToString())
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "User_List");
                }
                catch
                {
                }
            }

            return(View(model));
        }
コード例 #9
0
        public void SendCanceledEmail(long Pnrid, string PNR, string PassengerName, string AgentName, string City, DateTime BookedOn)
        {
            try
            {
                int agentid = ent.PNRs.Where(x => x.PNRId == Pnrid).Select(y => y.AgentId).FirstOrDefault();

                string agentemailaddress = ent.Agents.Where(x => x.AgentId == agentid).Select(y => y.Email).FirstOrDefault();


                string subject = "Cancellation Notification:" + " " + PNR + " " + PassengerName;


                StringBuilder st = new StringBuilder();
                st.AppendFormat(@"<p>
        Dear {0} ,<br />
        <br />
        The following reservation has been cancelled by the airline:</p>
    <div style='background-color: #521831; padding: 0.5% 2%; font-family: Arial, 

Helvetica, sans-serif;
        width: 94%; margin: 0px 1%; text-align: center; color: #fff;'>
        <h2>
            Ticket Cancel Notification</h2>

        <table width='100%' cellpadding='' cellspacing='' style='border: 1px solid 

#fff;
            background-color: #eaeaea; text-align: left; color: #000;'>
            <tbody>
                <tr>
                    <td>
                        <strong>Agency</strong></td>
                    <td>
                      {1}
                    </td>
                </tr>

                <tr>
                    <td>
                        <strong>PNR Name</strong>
                    </td>
                    <td>
                       {2}
                    </td>
                </tr>
                <tr>

                    <td>
                        <strong>Sector</strong>
                    </td>
                    <td>
                       {3}
                    </td>
                </tr>
                <tr>
                    <td>

                        <strong>Booking Ref. No</strong>
                    </td>
                    <td>
                        {4}
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>Booked Date</strong></td>

                    <td>
                       {5}</td>
                </tr>
            </tbody>
        </table>
    </div> ", AgentName, AgentName, PassengerName, City, PNR, TimeFormat.DateFormat(BookedOn.ToString()));


                ent.CORE_SendEmails(agentemailaddress, string.Empty, string.Empty, subject, st.ToString(), "HTML", "HIGH");
            }
            catch
            {
            }
        }
コード例 #10
0
        public ActionResult Index1(ExportModel Expmodel, SalesReportModel model, FormCollection frm, int?pageNo, int?flag)
        {
            var ts = SessionStore.GetTravelSession();

            var agentId = frm["SalesAgentId"];

            if (agentId != "")
            {
                model.AgentId = int.Parse(frm["SalesAgentId"]);
            }
            else
            {
                model.AgentId = null;
            }


            var fromdate = frm["SalesFromDate"];

            if (fromdate != "")
            {
                model.FromDate = DateTime.Parse(frm["SalesFromDate"]);
            }
            else
            {
                model.FromDate = null;
            }

            var todate = frm["SalesToDate"];

            if (todate != "")
            {
                model.ToDate = DateTime.Parse(frm["SalesToDate"]);
            }
            else
            {
                model.ToDate = null;
            }

            var currency = frm["SalesCurrency"];

            if (currency != "")
            {
                model.Currency = int.Parse(frm["SalesCurrency"]);
            }
            else
            {
                model.Currency = null;
            }


            var detailsSummary = ser.GetSalesReportSummary(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, model.Currency);


            model.salesReportSummary = detailsSummary;



            var details = ser.GetSalesReportSummaryDetails(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, model.Currency);

            model.salesReportDetails = details;

            //export
            ctrlBKT.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.salesReportDetails.Select(m => new
                    {
                        Code             = m.AirlineCode,
                        Agent_Name       = m.AgentName,
                        Ticket_No        = m.TicketNumber,
                        Issued_Date      = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                        Cash             = m.Cash,
                        Tax              = m.Tax,
                        Comm             = m.Commission,
                        Payable          = m.Payable,
                        Service_Provider = m.serviceProviderName,
                        Issued_From      = m.issueFrom
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "SalesReport");
                }
                catch (Exception ex)
                {
                    TempData["ActionResponse"] = ex.Message;
                }
            }
            var agents = defaultProvider.GetAgentList().Where(x => x.CreatedBy == ts.AppUserId);

            ViewData["AgentList"]    = new SelectList(agents, "AgentId", "AgentName");
            ViewData["AirlineTypes"] = new SelectList(ser.GetAirlineTypesList(), "AirineTypeId", "TypeName");

            return(View(model));
        }
コード例 #11
0
        public ActionResult Details(ATLTravelPortal.Areas.Airline.Models.ExportModel Expmodel, SalesReportModel model, FormCollection frm)
        {
            model.ReportHeading   = model.Name;
            model.InformationList = salesReportProvider.GetLedgerInformation(model.LedgerId, model.ReportOf, model.CurrencyId, model.FromDate, model.ToDate, model.ReportType);
            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 counter = 0;
                    if (model.ReportType == 1)
                    {
                        var exportData = model.InformationList.Select(m => new
                        {
                            SN      = ++counter,
                            Airline = m.AirlineName,
                            MPNRID  = m.MpnrId,
                            ServiceProvider_Name = m.ServiceProviderName,
                            Sector        = m.Sector,
                            Issued_Date   = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                            Issued_From   = m.IssuedFrom,
                            Ticket_Number = m.TicketNumber,
                            Amount        = m.Amount
                        });
                        App_Class.AppCollection.Export(Expmodel, exportData, "Sales Report");
                    }
                    if (model.ReportType == 2)
                    {
                        var exportData = model.InformationList.Select(m => new
                        {
                            SN                   = ++counter,
                            Hotel_Name           = m.HotelName,
                            Country_Name         = m.CountryName,
                            City_Name            = m.CityName,
                            ServiceProvider_Name = m.ServiceProviderName,
                            Issued_Date          = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                            No_Of_Night          = m.NOofNight,
                            No_Of_Room           = m.NoofRoom,
                            Amount               = m.Amount
                        });
                        App_Class.AppCollection.Export(Expmodel, exportData, "Sales Report");
                    }
                    if (model.ReportType == 3)
                    {
                        var exportData = model.InformationList.Select(m => new
                        {
                            SN                   = ++counter,
                            SalesTranId          = m.SalesTranId,
                            ServiceType          = m.ServiceType,
                            Customer_MobileNo    = m.CustomerMobileNo,
                            ServiceProvider_Name = m.ServiceProviderName,
                            Issued_Date          = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                            Created_Date         = m.CreatedDate,
                            Amount               = m.Amount
                        });
                        App_Class.AppCollection.Export(Expmodel, exportData, "Sales Report");
                    }
                    if (model.ReportType == 4)
                    {
                        var exportData = model.InformationList.Select(m => new
                        {
                            SN                   = ++counter,
                            BusMasterName        = m.BusMasterName,
                            BusPNRId             = m.BusPNRId,
                            ServiceProvider_Name = m.ServiceProviderName,
                            Passenger_Name       = m.PassengerName,
                            Sector               = m.Sector,
                            Issued_Date          = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                            Amount               = m.Amount
                        });
                        App_Class.AppCollection.Export(Expmodel, exportData, "Sales Report");
                    }

                    if (model.ReportType == 5)
                    {
                        var exportData = model.InformationList.Select(m => new
                        {
                            SN             = ++counter,
                            Passenger_Name = m.PassengerName,
                            TrainNo        = m.TrainNo,
                            Sector         = m.Sector,
                            Issued_Date    = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                            TrainPNRId     = m.TrainPNRId,
                            Amount         = m.Amount
                        });
                        App_Class.AppCollection.Export(Expmodel, exportData, "Sales Report");
                    }
                }
                catch
                {
                }
            }
            return(View(model));
        }
コード例 #12
0
        public ActionResult Index1(ExportModel Expmodel, SalesReportModel model, FormCollection frm, int?pageNo, int?flag)
        {
            var ts = (TravelSession)Session["TravelPortalSessionInfo"];

            var agentId = frm["SalesAgentId"];

            if (agentId != "")
            {
                model.AgentId = int.Parse(frm["SalesAgentId"]);
            }
            else
            {
                model.AgentId = null;
            }


            var fromdate = frm["SalesFromDate"];

            if (fromdate != "")
            {
                model.FromDate = DateTime.Parse(frm["SalesFromDate"]);
            }
            else
            {
                model.FromDate = null;
            }

            var todate = frm["SalesToDate"];

            if (todate != "")
            {
                model.ToDate = DateTime.Parse(frm["SalesToDate"]);
            }
            else
            {
                model.ToDate = null;
            }

            var currency = frm["SalesCurrency"];

            if (currency != "")
            {
                model.Currency = int.Parse(frm["SalesCurrency"]);
            }
            else
            {
                model.Currency = null;
            }



            model.salesReportSummary = ser.GetIndianLccSalesReport(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, 3);
            model.salesReportDetails = ser.GetIndianLccSalesReportDetails(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, 3);


            //export
            ctrlBKT.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.salesReportDetails.Select(m => new
                    {
                        Code        = m.AirlineCode,
                        Name        = m.AgentName,
                        Issued_Date = TimeFormat.DateFormat(m.IssuedDate.ToString()),
                        Cash        = m.Cash,
                        Tax         = m.Tax,
                        Comm        = m.Commission,
                        Payable     = m.Payable,
                    });
                    App_Class.AppCollection.Export(Expmodel, exportData, "SalesReport");
                }
                catch (Exception ex)
                {
                    TempData["ActionResponse"] = ex.Message;
                }
            }


            ViewData["AgentList"]    = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName");
            ViewData["AirlineTypes"] = new SelectList(ser.GetAirlineTypesList(), "AirineTypeId", "TypeName");

            return(View(model));
        }
コード例 #13
0
        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));
        }