// GET: Group/Create
        public ActionResult Create()
        {
            var userName = User.Identity.GetUserName();
            var model    = new com.GreenThumb.BusinessLogic.UserManager().GetUserByUserName(userName);

            return(View(model));
        }
Exemple #2
0
        /// <summary>
        /// Author: Trent
        /// Get: Index
        /// UpdateBy: Chris Schwebach
        /// Date: 3/31/16
        /// User data
        /// </summary>
        public async Task <ActionResult> Index(ManageMessageId?message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
                : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set."
                : message == ManageMessageId.Error ? "An error has occurred."
                : " ";

            var userName = User.Identity.GetUserName();
            var model    = new com.GreenThumb.BusinessLogic.UserManager().GetUserByUserName(userName);

            return(View(model));
        }
Exemple #3
0
        // GET: Articles
        public ActionResult Articles()
        {
            var articles = new BlogManager().GetBlogs();
            List <ArticlesViewModel> blogs = new List <ArticlesViewModel>();

            foreach (Blog blog in articles)
            {
                ArticlesViewModel model = new ArticlesViewModel();
                int userId   = blog.CreatedBy;
                var userInfo = new com.GreenThumb.BusinessLogic.UserManager().GetPersonalInfo(userId);
                model.FirstName = userInfo.FirstName;
                model.LastName  = userInfo.LastName;
                model.blog      = blog;
                blogs.Add(model);
            }
            return(View(blogs));
        }
Exemple #4
0
        /// <summary>
        /// Gets Articles
        /// Date: 4/29/16
        /// Author: Chris Schwebach
        /// </summary>
        /// <param name=" UserID"></param>
        /// <returns>Article List</returns>
        public ActionResult Index()
        {
            var articles = new BlogManager().GetBlogs();
            List <ArticlesViewModel> blogs = new List <ArticlesViewModel>();

            foreach (Blog blog in articles)
            {
                ArticlesViewModel model = new ArticlesViewModel();
                int userId   = blog.CreatedBy;
                var userInfo = new com.GreenThumb.BusinessLogic.UserManager().GetPersonalInfo(userId);
                model.FirstName = userInfo.FirstName;
                model.LastName  = userInfo.LastName;
                model.blog      = blog;
                blogs.Add(model);
            }

            ViewBag.IsExpert = new GroupManager().IsGroupMember(WebConfigurationManager.AppSettings["ExpertGroup"], RetrieveUserId());

            return(View(blogs));
        }