Пример #1
0
        public ActionResult Canceled(ExportModel Expmodel, TrainBookingRequestModel model, FormCollection frm, int?page)
        {
            TrainBookingRequestRepository _rep = new TrainBookingRequestRepository();

            model.StatusId        = 2;
            model.PagedList       = _rep.GetPendingBookingPagedList(model, page);
            ViewData["AgentList"] = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName");
            if (TrainGeneralRepository.Message != null)
            {
                model.Message = TrainGeneralRepository.Message;
            }
            else
            {
                model.Message = _msg;
            }
            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 = _rep.List(model).Select(m => new
                    {
                        Sno            = m.SNo,
                        Passenger_Name = m.FullName,
                        Sector         = m.Sector,
                        DepartureDate  = m.DepartureDate,

                        RequestDate      = m.CreateDate,
                        TicketStatusName = m.StatusName,
                        RequestBy        = m.CreatedByName,
                        Request_ID       = "AH-TR-" + m.TrainPNRId.ToString().PadLeft(5, '0')
                    });

                    App_Class.AppCollection.Export(Expmodel, exportData, "TrainBookingRequestList");
                }
                catch (Exception ex)
                {
                    ATLTravelPortal.Utility.ErrorLogging.LogException(ex);
                }
            }
            return(View(model));
        }
Пример #2
0
        public ActionResult Issued(int?page, TrainBookingRequestModel _model)
        {
            //TrainBookingRequestModel _model = new TrainBookingRequestModel();
            TrainBookingRequestRepository _rep = new TrainBookingRequestRepository();

            _model.StatusId  = 4;
            _model.PagedList = _rep.GetPendingBookingPagedList(_model, page);
            if (TrainGeneralRepository.Message != null)
            {
                _model.Message = TrainGeneralRepository.Message;
            }
            else
            {
                _model.Message = _msg;
            }
            ViewData["AgentList"] = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName");
            return(View(_model));
        }