MindRocketsInc.App.SLReport/SlReport/SignLanguageReportApiClient.cs

109 lines
2.9 KiB
C#
Raw Permalink Normal View History

using MindRockets.WebTools.Client;
using MindRockets.WebTools.Contracts;
using System;
using System.Collections.Generic;
public class SignLanguageReportApiClient : ModernAPIClient
{
public SignLanguageReportApiClient(string endPointHost)
: base(endPointHost)
{
}
public Guid RegisterUser(string username, string pwd)
{
var data = new Dictionary<string, object>
{
{ "username", username },
{ "pwd", pwd }
};
return PostAction<Guid>("slrep", "reguser", data.Secure(), true);
}
public bool RegisterClient(string cid, string srv)
{
var data = new Dictionary<string, object>
{
{ "cid", cid },
{ "srv", srv }
};
return PostAction<bool>("slrep", "regclient", data.Secure(), true);
}
public bool MapUser(Guid userId, string cid, string srv)
{
var data = new Dictionary<string, object>
{
{ "userid", userId.ToString() },
{ "cid", cid },
{ "srv", srv }
};
return PostAction<bool>("slrep", "mapuser", data.Secure(), true);
}
public bool Capture(string cid, string srv)
{
var data = new Dictionary<string, object>
{
{ "cid", cid },
{ "srv", srv }
};
return PostAction<bool>("slrep", "capt", data.Secure(), true);
}
public List<ClientHistory> ReportAllClientHistory(string cid, string srv)
{
var data = new Dictionary<string, object>
{
{ "cid", cid },
{ "srv", srv }
};
return PostAction<List<ClientHistory>>("slrep", "repallcid", data.Secure(), true);
}
public List<ClientHistory> ReportClientHistory(
string cid,
string srv,
DateTime from,
DateTime to)
{
var data = new Dictionary<string, object>
{
{ "cid", cid },
{ "srv", srv },
{ "from", from },
{ "to", to }
};
return PostAction<List<ClientHistory>>("slrep", "repcid", data.Secure(), true);
}
public List<ClientInfo> ListAllClients()
{
return PostAction<List<ClientInfo>>("slrep", "listallclients", NoParams.Secure(), true);
}
}
public class ClientInfo
{
public string cid { get; set; }
public string srv { get; set; }
public DateTime addingDate { get; set; }
public DateTime? lastCaptDate { get; set; }
public int NoOfCapt { get; set; }
}
public class ClientHistory
{
public DateTime captDate { get; set; }
public int NoOfSessions { get; set; }
}