Beispiel #1
0
        public ActionResult prosjektMeny()//Kategori meny
        {
            string userName = HttpContext.User.Identity.Name;

            List <ProsjektVis> pro = _ProsjektBLL.HentProsjekter(userName);

            return(PartialView(pro));
        }
Beispiel #2
0
        public HttpResponseMessage Get()
        {
            string userName = User.Identity.Name;

            var liste = _ProsjektBLL.HentProsjekter(userName);

            var    Json       = new JavaScriptSerializer();
            string JsonString = Json.Serialize(liste);

            if (liste.Count() > 0)
            {
                return(new HttpResponseMessage()
                {
                    Content = new StringContent(JsonString, Encoding.UTF8, "application/json"),
                    StatusCode = HttpStatusCode.OK
                });
            }
            return(new HttpResponseMessage()
            {
                StatusCode = HttpStatusCode.NotFound,
                Content = new StringContent("Kunne ikke hente prosjekter")
            });
        }