51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Script.Serialization;
|
|
using EnVisage.Controllers;
|
|
using EnVisage.Models;
|
|
using EnVisage.Code;
|
|
|
|
namespace EnVisage.Code.UserVoice
|
|
{
|
|
public class UserVoiceApi
|
|
{
|
|
#region Constructors
|
|
public UserVoiceApi()
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public string guid { get; set; }
|
|
public string email { get; set; }
|
|
public string display_name { get; set; }
|
|
public string locale { get; set; }
|
|
public string SsoToken { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
public string GetUserJsonObject(ApplicationUser user)
|
|
{
|
|
string jsonUser = "";
|
|
var javaScriptSerializer = new JavaScriptSerializer();
|
|
|
|
this.guid = user.Id;
|
|
this.email = user.Email;
|
|
this.display_name = user.UserName;
|
|
|
|
//TODO: let's not hardwire this and get it stored on the ApplicationUser
|
|
this.locale = "en"; //-- default to english
|
|
|
|
jsonUser = javaScriptSerializer.Serialize(this);
|
|
|
|
return jsonUser;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |