Example #1
0
        internal void GetCompanyInfo()
        {
            PreferredEndpoints = new Dictionary <string, string>();
            CompanyIDs         = new Dictionary <string, int>();
            var companyInfo  = HttpRestClient.RequestReport("master/relationships", "", "");
            var divisionList = Enum.GetNames(typeof(Divisions));

            if (PreferredEndpoints.Count != 0)
            {
                return;
            }

            var test = (DataTable)JsonConvert.DeserializeObject(companyInfo, typeof(DataTable));

            // TODO: beter way to do this???
            foreach (var division in divisionList)
            {
                var expression = "CompanyName = \'" + division + "\'";
                var t          = test.Select(expression);
                PreferredEndpoints.Add(t[0]["CompanyName"].ToString(), t[0]["PreferredEndpoint"].ToString());
                CompanyIDs.Add(t[0]["CompanyName"].ToString(), Convert.ToInt32(t[0]["CompanyID"]));
            }
        }
Example #2
0
 internal void AbandonSession()
 {
     HttpRestClient.RequestReport("session/abandon", "", "");
 }