45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
namespace PWAPPv2.Source.DataObjects
|
|
{
|
|
public class APICredentials
|
|
{
|
|
public string UserID;
|
|
public string Password;
|
|
public string PracticeId;
|
|
public string APIid;
|
|
|
|
public APICredentials()
|
|
{
|
|
|
|
}
|
|
|
|
public APICredentials(Source.APIConfig config)
|
|
{
|
|
UserID = config.PWUserID;
|
|
Password = config.PWPassword;
|
|
PracticeId = config.PWPracticeID;
|
|
APIid = config.PWApiID;
|
|
}
|
|
|
|
public APICredentials(Source.Config.Configuration practiceConfig)
|
|
{
|
|
UserID = practiceConfig.Get("pwuserid");
|
|
Password = practiceConfig.Get("pwpassword");
|
|
PracticeId = practiceConfig.Get("pwpracticeid");
|
|
APIid = practiceConfig.Get("pwapiid");
|
|
}
|
|
|
|
public string BuildJsonBodyContents()
|
|
{
|
|
return "'UserID':'" + UserID + "'," +
|
|
"'Password':'" + Password + "'," +
|
|
"'PracticeId':'" + PracticeId + "'," +
|
|
"'APIid':'" + APIid + "'";
|
|
}
|
|
|
|
public string ToJsonString()
|
|
{
|
|
return "\"{" + BuildJsonBodyContents() + "}\"";
|
|
}
|
|
}
|
|
}
|