コード例 #1
0
        public ActionResult Index(int?page, BusPNRModel _model, DateTime?FromDate, DateTime?ToDate)
        {
            BusGeneralRepository.SetRequestPageRow();

            try
            {
                var ts = (TravelSession)Session["TravelPortalSessionInfo"];
                //_model.FromDate = Session["FromDate"] == null ? DateTime.Now.AddDays(-15) : Convert.ToDateTime(Session["FromDate"]);
                //_model.ToDate = Session["ToDate"] == null ? DateTime.Now : Convert.ToDateTime(Session["ToDate"]);

                if (FromDate == null && ToDate == null)
                {
                    _model.FromDate = ATLTravelPortal.Repository.GeneralRepository.CurrentDateTime().AddDays(-15);
                    _model.ToDate   = ATLTravelPortal.Repository.GeneralRepository.CurrentDateTime();
                }
                else
                {
                    _model.FromDate = FromDate;
                    _model.ToDate   = ToDate;
                }

                ViewData["DisList"] = new SelectList(defaultProvider.GetDistributorList(ts.LoginTypeId), "DistributorId", "DistributorName");
                _model.TabularList  = busBookedTicketProvider.GetBranchPagedBookedTicketList(page, _model.FromDate, _model.ToDate, _model.AgentId, ts.LoginTypeId);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            _model.Message = _res;
            return(View(_model));
        }
コード例 #2
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));
        }
コード例 #3
0
        public ActionResult Index(int?page, BusPNRModel _model)
        {
            UnIssuedTicketRepository _rep = new UnIssuedTicketRepository();

            BusGeneralRepository.SetRequestPageRow();
            try
            {
                var ts = (TravelSession)Session["TravelPortalSessionInfo"];
                _model.FromDate = Session["FromDate"] == null?DateTime.Now.AddDays(-15) : Convert.ToDateTime(Session["FromDate"]);

                _model.ToDate = Session["ToDate"] == null ? DateTime.Now : Convert.ToDateTime(Session["ToDate"]);

                ViewData["AgentList"] = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName");
                _model.TabularList    = _rep.GetPagedIssueList(page, _model.FromDate, _model.ToDate, ts.LoginTypeId);
                if (BusGeneralRepository.ActionMessage != null)
                {
                    _res = BusGeneralRepository.ActionMessage;
                }
            }
            catch (Exception ex)
            {
                _res = BusGeneralRepository.CatchException(ex);
            }
            _model.Message = _res;
            return(View(_model));
        }
コード例 #4
0
        public ActionResult Edit(int?id)
        {
            BusMasterModel      _model = new BusMasterModel();
            BusMasterRepository _rep   = new BusMasterRepository();

            try
            {
                _model = _rep.Detail(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _model.Message;
            return(View(_model));
        }
コード例 #5
0
        public ActionResult Index(int?page)
        {
            BusMasterModel      _model = new BusMasterModel();
            BusMasterRepository _rep   = new BusMasterRepository();

            BusGeneralRepository.SetRequestPageRow();
            try
            {
                _model.TabularList = _rep.GetPagedList(page);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            _model.Message = _res;
            return(View(_model));
        }
コード例 #6
0
        public ActionResult Delete(int?id)
        {
            BusMasterModel      _model = new BusMasterModel();
            BusMasterRepository _rep   = new BusMasterRepository();

            try
            {
                _model.Message = _rep.Delete(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }

            BusGeneralRepository.ActionMessage = _model.Message;
            return(RedirectToAction("Index"));
        }
コード例 #7
0
        public ActionResult Edit(int?id)
        {
            OperatorBusCategoryModel      _model = new OperatorBusCategoryModel();
            OperatorBusCategoryRepository _rep   = new OperatorBusCategoryRepository();

            try
            {
                _model = _rep.Detail(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _model.Message;
            _model = _rep.Fill(_model);
            return(View(_model));
        }
コード例 #8
0
        public ActionResult Index(BusPNRModel model, int?page)
        {
            UnIssuedTicketRepository _rep = new UnIssuedTicketRepository();

            BusGeneralRepository.SetRequestPageRow();
            try
            {
                model.FromDate = DateTime.Now.AddDays(-15);
                model.ToDate   = DateTime.Now;

                ViewData["AgentList"] = new SelectList(defaultProvider.GetAgentList(), "AgentId", "AgentName");

                model.TabularList = _rep.GetPagedList(page, model.AgentId);
            }
            catch (Exception ex)
            {
                model.Message = BusGeneralRepository.CatchException(ex);
            }
            model.Message = _res;
            return(View(model));
        }
コード例 #9
0
        public ActionResult Create(BusMasterModel model)
        {
            BusMasterRepository _rep = new BusMasterRepository();

            try
            {
                model.Message = _rep.Create(model);
            }
            catch (Exception ex)
            {
                model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _res;
            if (model.Message.MsgNumber == 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(model));
            }
        }
コード例 #10
0
        public ActionResult Edit(BusCityModel model)
        {
            BusCityRepository _rep = new BusCityRepository();

            try
            {
                model.Message = _rep.Edit(model);
            }
            catch (Exception ex)
            {
                model.Message = BusGeneralRepository.CatchException(ex);
            }
            if (model.Message.MsgNumber == 0)
            {
                BusGeneralRepository.ActionMessage = model.Message;
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(model));
            }
        }
コード例 #11
0
        public ActionResult Details(int?id)
        {
            BusMasterModel      _model = new BusMasterModel();
            BusMasterRepository _rep   = new BusMasterRepository();

            try
            {
                _model = _rep.Detail(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _res;
            if (_model.Message.MsgNumber == 0)
            {
                return(View(_model));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
コード例 #12
0
        public ActionResult Print(long?id)
        {
            BusPNRModel _model            = new BusPNRModel();
            UnIssuedTicketRepository _rep = new UnIssuedTicketRepository();

            try
            {
                _model = _rep.GetBusPNRModelByBusPNRId(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _model.Message;
            if (_model.Message.MsgNumber == 0)
            {
                return(View(_model));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
コード例 #13
0
        public ActionResult Create(OperatorBusCategoryModel model)
        {
            OperatorBusCategoryRepository _rep = new OperatorBusCategoryRepository();

            model = _rep.Fill(model);
            try
            {
                model.Message = _rep.Create(model);
            }
            catch (Exception ex)
            {
                model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _res;
            if (model.Message.MsgNumber == 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(model));
            }
        }