コード例 #1
0
        // GET: Armies
        public ActionResult Index()
        {
            List <ArmyBLL> armies = null;

            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {
                    armies = ctx.ArmiesGetAll(Constants.DefaultPageNumber, Constants.DefaultPageSize);
                }
            }
            catch (Exception oops)
            {
                Error.Log(oops);
                return(View("Error", oops));
            }
            return(View(armies));
        }
コード例 #2
0
        // GET: ArmyModels
        public ActionResult Index()
        {
            if (!User.IsInRole("Developer") && !User.IsInRole("Administrator"))
            {
                return(RedirectToAction("MyIndex"));
            }
            List <ArmyBLL> armies = null;

            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {
                    armies = ctx.ArmiesGetAll(Constants.DefaultPageNumber, Constants.DefaultPageSize);
                }
            }
            catch (Exception oops)
            {
                Error.Log(oops);
                return(View("Error", oops));
            }
            return(View(armies));
        }