public ActionResult Create()
        {
            BusCategoryModel      _model = new BusCategoryModel();
            BusCategoryRepository _rep   = new BusCategoryRepository();

            _model.Message = _res;
            return(View(_model));
        }
        public ActionResult Edit(int?id)
        {
            BusCategoryModel      _model = new BusCategoryModel();
            BusCategoryRepository _rep   = new BusCategoryRepository();

            try
            {
                _model = _rep.Detail(id);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            BusGeneralRepository.ActionMessage = _model.Message;
            return(View(_model));
        }
 public UnitOfWork(BusTicketContext context)
 {
     _context          = context;
     Vendor            = new VendorRepository(_context);
     BusDetail         = new BusDetailRepository(_context);
     Route             = new RouteRepository(_context);
     BusCategory       = new BusCategoryRepository(_context);
     Brand             = new BrandRepository(_context);
     PaymentType       = new PaymentTypeRepository(_context);
     PromoOffer        = new PromoOfferRepository(_context);
     BusReservation    = new BusReservationRepository(_context);
     SeatLayout        = new SeatLayoutRepository(_context);
     TicketReservation = new TicketReservationRepository(_context);
     VendorPayment     = new VendorPaymentRepository(_context);
     Payment           = new PaymentRepository(_context);
 }
        public ActionResult Index(int?page)
        {
            BusCategoryModel      _model = new BusCategoryModel();
            BusCategoryRepository _rep   = new BusCategoryRepository();

            BusGeneralRepository.SetRequestPageRow();
            try
            {
                _model.TabularList = _rep.GetPagedList(page);
            }
            catch (Exception ex)
            {
                _model.Message = BusGeneralRepository.CatchException(ex);
            }
            _model.Message = _res;
            return(View(_model));
        }
        public ActionResult Delete(int?id)
        {
            BusCategoryModel      _model = new BusCategoryModel();
            BusCategoryRepository _rep   = new BusCategoryRepository();

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

            BusGeneralRepository.ActionMessage = _model.Message;
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(BusCategoryModel model)
        {
            BusCategoryRepository _rep = new BusCategoryRepository();

            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));
            }
        }
        public ActionResult Create(BusCategoryModel model)
        {
            BusCategoryModel      _model = new BusCategoryModel();
            BusCategoryRepository _rep   = new BusCategoryRepository();

            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));
            }
        }