Ejemplo n.º 1
0
        // GET: /scheme/Create
        public ActionResult Create()
        {
            ResultMessages <schemeViewModel> result = null;

            try
            {
                result = new ResultMessages <schemeViewModel>(true, string.Empty);
                var routes = _routesService.GetQueryable(x => x.Id != null);
                ViewBag.routes       = new SelectList(routes.ToList(), "Id", "Name");
                ViewData["RoutesId"] = ViewBag.routes;

                var fees = _feesService.GetQueryable(x => x.Id != null);
                ViewBag.fees = new SelectList(fees.ToList(), "Id", "Name");

                var channels = _channelsService.GetQueryable(x => x.Id != null);
                ViewBag.channels = new SelectList(channels.ToList(), "Id", "Name");

                var trans = _transTypeService.GetQueryable(x => x.Id != null);
                ViewBag.trans = new SelectList(trans.ToList(), "Id", "Name");
            }
            catch (Exception ex)
            {
                result = new ResultMessages <schemeViewModel>(false, ex.Message);
            }
            return(View(result));
        }
Ejemplo n.º 2
0
        // private SwitchContext db = new SwitchContext();

        // GET: /channels/
        public async Task <ActionResult> Index()
        {
            var data = _channelsService.GetQueryable(x => x.Id != null);

            return(View(data.OrderBy(x => x.Name)));
        }