Пример #1
0
        public ActionResult BadgeCreate(Badge b)
        {
            var service = new GstService(SystemContext.GstConnectionString);

            if (ModelState.IsValid)
            {
                service.Create(b);
                return(RedirectToAction("BadgeBank"));
            }

            // Return same Badge if invalid field(s)
            return(View(b));
        }
Пример #2
0
        public ActionResult GiveBadge(BadgeHistory b)
        {
            var service = new GstService(SystemContext.GstConnectionString);

            b.TimeStamp = DateTime.Now;

            var badge = service.ReadSingleBadge(b.BadgeId);
            var giver = service.ReadSinglePerson(b.GiverId);

            if (ModelState.IsValid)
            {
                service.Create(b);
                return(RedirectToAction("GridView"));
            }

            return(View(b));
        }