Exemple #1
0
        // GET: ArmyModels
        public ActionResult MyIndex()
        {        //Grabs an index of armies owned by user
            List <ArmyBLL> armies = null;

            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {                // we retrieve the user by his Name in User.Identity then get his armies
                    UserBLL Me = ctx.UserFindByName(User.Identity.Name);
                    armies = ctx.ArmiesFindByUserID(Me.UserID, Constants.DefaultPageNumber, Constants.DefaultPageSize);
                }
            }
            catch (Exception oops)
            {
                Error.Log(oops);
                return(View("error", oops));
            }
            return(View("index", armies));
        }