Пример #1
0
        // GET: Place where user id==current user id
        public ActionResult Index()
        {
            ClaimsPrincipal currentUser = User;

            var userId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;

            PlaceClient client = new PlaceClient();

            ViewBag.Placelist = client.GetPlaceList(userId);


            return(View());
        }
Пример #2
0
        public List <SelectListItem> GetPlaceList(string id)
        {
            PlaceClient         ac         = new PlaceClient();
            IEnumerable <Place> enumerable = ac.GetPlaceList(id);
            var types    = new List <SelectListItem>();
            var iterator = 0;

            foreach (var el in enumerable)
            {
                iterator++;
                types.Add(new SelectListItem()
                {
                    Text = el.Name.ToString(), Value = el.Id.ToString()
                });
            }



            return(types);
        }