// GET: ComboItems/Create
        public ActionResult Create()
        {
            //in the get, a list of users to select is presented
            MyIdentityManager myIdentityManager = new MyIdentityManager();
            var allUsers = myIdentityManager.GetAllUsers();


            return(View());
        }
Exemple #2
0
        //called by API()
        public ActionResult UsersToJson()
        {
            MyIdentityManager myIdentityManager = new MyIdentityManager();
            var           allUsers  = myIdentityManager.GetAllUsers();
            List <string> usermanes = new List <string>();

            foreach (var applicationUser in allUsers)
            {
                usermanes.Add(applicationUser.UserName);
            }

            var serialized = JsonConvert.SerializeObject(usermanes);

            myIdentityManager.Dispose();
            return(Content(serialized, typeof(Json).Name));
        }
Exemple #3
0
        public ActionResult UsersToXml()
        {
            string            xml = "<?xml version = \"1.0\" encoding= \"utf-8\"?>";
            MyIdentityManager myIdentityManager = new MyIdentityManager();
            var users = myIdentityManager.GetAllUsers();

            xml = xml + "<Users>";
            foreach (var user in users)
            {
                xml = xml + "<Name>";
                xml = xml + user.Id;
                xml = xml + "</Name>";
            }
            xml = xml + "</Users>";

            myIdentityManager.Dispose();
            return(Content(xml, "text/xml"));
        }