public List<String> GetTopForDate(String date, int quantity, int idUser) { Dictionary<int, int> dictionaryTops = new Dictionary<int, int>(); List<String> tops = new List<String>(); DBMaster dbMaster = new DBMaster(); JSONMaster JSON = new JSONMaster(); dictionaryTops = dbMaster.FindByDate(date, quantity, idUser); tops = JSON.GetListTop(dictionaryTops); return tops; }
public RedirectResult GetToken(string code) { List<String> userInfo = new List<String>(); JSONMaster master = new JSONMaster(); using (var request = new xNet.HttpRequest()) { String uri = string.Format( "https://oauth.vk.com/access_token?client_id={0}&client_secret={1}&redirect_uri={2}&code={3}", AppID, client_secret, redirect_uri, code); String data = request.Get(uri).ToString(); userInfo.AddRange(master.GetAccessToken(data)); } String url = string.Format("http://localhost:61745/UserData/CreateUser?user_id={0}&token={1}", userInfo.ElementAt(1), userInfo.ElementAt(0)); return Redirect(url); }