Пример #1
0
        public ActionResult Process(ExportModel Expmodel, TrainBookingRequestModel model, FormCollection frm, int?page)
        {
            TrainBookingRequestRepository _rep = new TrainBookingRequestRepository();
            var ts = (TravelSession)Session["TravelPortalSessionInfo"];

            model.StatusId      = 7;
            model.PagedList     = _rep.GetBranchProcessBookingPagedList(model, page, ts.LoginTypeId);
            ViewData["DisList"] = new SelectList(defaultProvider.GetDistributorList(ts.LoginTypeId), "DistributorId", "DistributorName");
            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.BranchProcessList(model, ts.LoginTypeId).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 Process(int?page, TrainBookingRequestModel _model)
        {
            TrainBookingRequestRepository _rep = new TrainBookingRequestRepository();
            var ts = (TravelSession)Session["TravelPortalSessionInfo"];

            _model.StatusId  = 7;
            _model.PagedList = _rep.GetBranchProcessBookingPagedList(_model, page, ts.LoginTypeId);
            if (TrainGeneralRepository.Message != null)
            {
                _model.Message = TrainGeneralRepository.Message;
            }
            else
            {
                _model.Message = _msg;
            }
            ViewData["DisList"] = new SelectList(defaultProvider.GetDistributorList(ts.LoginTypeId), "DistributorId", "DistributorName");
            return(View(_model));
        }