Exemplo n.º 1
0
        public ActionResult Index()
        {
            var awards = awardDm.GetAll();

            ViewBag.Breadcrumb = new Breadcrumb("awards", null, null);
            return(View(awards));
        }
Exemplo n.º 2
0
 public IHttpActionResult Get(string filter = null)
 {
     if (string.IsNullOrEmpty(filter))
     {
         var awards = awardDm.GetAll();
         return(Json(awards));
     }
     else
     {
         var awards = awardDm.GetAwardsByFilter(filter);
         return(Json(awards));
     }
 }
Exemplo n.º 3
0
        public ActionResult GetAvaliableAward(int id)
        {
            var user = userDm.GetUserByID(id);

            ViewBag.Breadcrumb = new Breadcrumb("user", "Add award", user.Name);
            if (user != null)
            {
                var awards = awardDM.GetAll();
                user.Awards = awards.Except(user.Awards).ToList();
                return(View(user));
            }
            else
            {
                return(HttpNotFound());
            }
        }