Example #1
0
        //
        // GET: /NewsFeedItem/Create
        public ActionResult Create(int ? ItemType = -1)
        {
            NewsFeedItem n = new NewsFeedItem();
            n.ItemType = (int)ItemType;

            ViewBag.type = ItemType;

            if (ItemType <= 0 || ItemType > 4)
                return RedirectToAction("Index", "NewsFeed");

            return View(n);
        }
Example #2
0
        public ActionResult Create(NewsFeedItem newsfeeditem)
        {
            if (ModelState.IsValid)
            {
                newsfeeditem.ID = Guid.NewGuid();
                newsfeeditem.Created = DateTime.Now;
                newsfeeditem.Modified = DateTime.Now;
                newsfeeditem.UserID = _userRepo.FindAll(u => u.UserName == User.Identity.Name).FirstOrDefault().ID;
                _newsFeedItemRepo.Add(newsfeeditem);
                return RedirectToAction("Index", "NewsFeed");
            }

            return View(newsfeeditem);
        }
Example #3
0
 public void Setup()
 {
     _newsFeedItem = new NewsFeedItem();
 }