Release of v24.
This commit is contained in:
@@ -11,6 +11,8 @@ namespace BodyshopPartner.Utils
|
||||
{
|
||||
//TODO: Change firebase API Key to be dependent on what environment monitor has been set for.
|
||||
public static string ActiveShopId = Properties.Settings.Default.LastSelectedShop;
|
||||
public static string ActiveShopName = "";
|
||||
public static string user = "";
|
||||
public static string ShopRegion = "";
|
||||
public static dynamic CiecaOpCodes;
|
||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace BodyshopPartner.Utils
|
||||
logger.Trace("Refresh timer interval set to {0}ms", (authlink.ExpiresIn - 600) * 1000);
|
||||
tokenTimer.Elapsed += TokenTimer_Tick;
|
||||
tokenTimer.Start();
|
||||
AppMetaData.user = Properties.Settings.Default.Username;
|
||||
return (true, null);
|
||||
}
|
||||
catch (FirebaseAuthException Ex)
|
||||
@@ -87,6 +88,7 @@ namespace BodyshopPartner.Utils
|
||||
tokenTimer.Elapsed += TokenTimer_Tick;
|
||||
tokenTimer.Start();
|
||||
|
||||
AppMetaData.user = Username;
|
||||
return (true, null);
|
||||
}
|
||||
catch (FirebaseAuthException Ex)
|
||||
|
||||
@@ -7,6 +7,9 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GraphQL.Client.Http;
|
||||
using GraphQL.Client.Serializer.Newtonsoft;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace BodyshopPartner.Utils
|
||||
{
|
||||
@@ -28,7 +31,30 @@ namespace BodyshopPartner.Utils
|
||||
{
|
||||
logger.Trace("Firing a GQL Query!");
|
||||
logger.Trace("Firing GQL Query: {0} {1}", r.Query.ToString(), r.Variables);
|
||||
|
||||
//var content = new content("grant_type=password&username=username&password=password");
|
||||
//content.Headers.Add("Content-Type", "application/json");
|
||||
dynamic postData = new JObject();
|
||||
postData.imexshopid = AppMetaData.ActiveShopName;
|
||||
postData.operationName = r.Query.ToString();
|
||||
postData.dbevent = true;
|
||||
postData.user = AppMetaData.user;
|
||||
postData.source = "Partner";
|
||||
var httpClient = new HttpClient();
|
||||
var content = new StringContent(postData.ToString(), Encoding.UTF8, "application/json");
|
||||
|
||||
try
|
||||
{
|
||||
httpClient.PostAsync("https://api.imex.online/ioevent", content);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex,"Unable to post to IOEVENT.");
|
||||
}
|
||||
|
||||
var graphQLResponse = await g.SendQueryAsync<dynamic>(r);
|
||||
|
||||
if (graphQLResponse.Errors == null)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user