/// <summary>
        /// Returns the list of gateways that belongs to user.
        /// </summary>
        /// <param name="Name">Filters list to gateways with names containing this string. (case-insensitive)</param>
        /// <param name="NetworkID">Filters list to gateway that belong to this network id</param>
        /// <param name="ApplicationID">Filters list to gateway that are this application type</param>
        /// <param name="Status">Filters list to gateway that match this status</param>
        /// <returns>gateway list</returns>
        public async Task <List <GatewayDTO> > GetGatewayList(string UserName, string Name = "", long NetworkID = 0, short ApplicationID = 0, short Status = 0)
        {
            string filter = "";

            if (!string.IsNullOrEmpty(Name))
            {
                filter = string.Format("Name={0}&", Name);
            }
            if (NetworkID != 0)
            {
                filter += string.Format("NetworkID={0}&", NetworkID);
            }
            if (ApplicationID != 0)
            {
                filter += string.Format("ApplicationID={0}&", ApplicationID);
            }
            if (Status != 0)
            {
                filter += string.Format("Status={0}&", Status);
            }

            filter = filter.EndsWith("&") ? filter.Remove(filter.Length - 1) : filter;

            if (string.IsNullOrEmpty(UserName))
            {
                return(await _httpService.GetAsAsync <List <GatewayDTO> >("GatewayList", filter, false));
            }
            else
            {
                return(await _httpService.GetWithUserAsync <List <GatewayDTO> >(UserName, "GatewayList", filter, false));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the currently loggeg in User info.
        /// </summary>
        /// <returns>User Model</returns>
        public async Task <UserWithAccountInfo> GetUserInfo()
        {
            var retVal = await _httpService.GetAsAsync <UserDetail>("User/GetUserInfo", "", true, false);

            if (retVal != null && retVal.User != null)
            {
                return(retVal.User);
            }
            return(null);
        }
Exemplo n.º 3
0
 public async Task <TaxableStates> GetTaxableStatebyStateCode(string StateCode)
 {
     try
     {
         return(await _httpService.GetAsAsync <TaxableStates>(TaxableStateClientEndPoint, string.Format("StateCode={0}", StateCode)));
     }
     catch (Exception)
     {
         return(null);
     }
 }
 /// <summary>
 /// Get the accountLocation details by AccountID
 /// </summary>
 /// <param name="AccountID">Unique indentofier for the Account</param>
 /// <returns>AccountLocation Model</returns>
 public async Task <AccountLocation> GetAccountLocationByID(long AccountID)
 {
     return(await _httpService.GetAsAsync <AccountLocation>(AccountLocationEndPoint + AccountID, ""));
 }
        //public async Task<object> CreateAccount( Acc Account Account)
        //{
        //    var query = HttpUtility.ParseQueryString(string.Empty);
        //    query["CompanyName"] = Account.CompanyName;
        //    query["TimeZoneID"] = Account.TimeZoneID.ToString();
        //    query["Address"] = Account.Address;
        //    query["Address2"] = Account.Address2;
        //    query["City"] = Account.City;
        //    query["State"] = Account.State;
        //    query["PostalCode"] = Account.PostalCode;
        //    query["Country"] = Account.Country;
        //    //query["ResellerID"] = Account.ResellerID.ToString();
        //    query["UserName"] = Account.UserName;
        //    query["Password"] = Account.Password;
        //    query["ConfirmPassword"] = Account.ConfirmPassword;
        //    query["FirstName"] = Account.FirstName;
        //    query["LastName"] = Account.LastName;
        //    query["NotificationEmail"] = Account.NotificationEmail;
        //    //query["NotificationPhone"] = Account.NotificationPhone;
        //    //query["SMSCarrierID"] = Account.SMSCarrierID.ToString();
        //    string path = string.Format("{0}CreateAccount/{1}", ConfigurationManager.AppSettings["NotifEyeAPIEndpoint"], query.ToString());
        //    var response =  await new HttpClient().GetAsync(path);
        //    object retVal = null;
        //    if(response.IsSuccessStatusCode)
        //    {
        //        retVal = (await response.Content.ReadAsAsync<APIResponse<GatewayDTO>>()).Result;
        //    }
        //    return Task.FromResult(retVal);
        //}

        #region NOTIFEYEAPI

        /// <summary>
        /// Get the users list for a given account
        /// </summary>
        /// <param name="AccountID">Unique identofier for the account</param>
        /// <returns>List of Users</returns>
        public async Task <List <UserInfo> > GetAccountUserList(long AccountID)
        {
            return(await _httpService.GetAsAsync <List <UserInfo> >("AccountUserList", string.Format("AccountID={0}", AccountID), false));
        }
        /// <summary>
        /// Returns data points recorded in a range of time (limited to a 12 hour window)
        /// </summary>
        /// <param name="Minutes">Number of minutes past Notifications will be returned</param>
        /// <param name="LastSentNotificationID">Limits notification results to notifications sent after this ID</param>
        /// <param name="SensorID">Limits which sensor notifications will come back. If this field is left null it will bring back all notifications for all sensors.</param>
        /// <returns>list of notification info</returns>
        public async Task <object> GetRecentlySentNotifications(short Minutes, long LastSentNotificationID = 0, long SensorID = 0)
        {
            string filter = string.Format("Minutes={0}&", Minutes);

            if (LastSentNotificationID != 0)
            {
                filter += string.Format("LastSentNotificationID={0}&", LastSentNotificationID);
            }
            if (SensorID != 0)
            {
                filter += string.Format("SensorID={0}&", SensorID);
            }

            filter = filter.EndsWith("&") ? filter.Remove(filter.Length - 1) : filter;


            return(await _httpService.GetAsAsync <object>("RecentlySentNotifications", filter, false, false));
        }
 /// <summary>
 /// Returns the list of supported Application Names and Id's.
 /// </summary>
 /// <returns>application info</returns>
 public async Task <object> GetApplications()
 {
     return(await _httpService.GetAsAsync <object>("GetApplicationID", "", false, true));
 }
 /// <summary>
 ///  Get the networkLocation details by CSNetID
 /// </summary>
 /// <param name="CSNetID">NetworkID</param>
 /// <returns>Networklocation Model</returns>
 public async Task <NetworkLocation> GetNetworkLocationByID(long CSNetID)
 {
     return(await _httpService.GetAsAsync <NetworkLocation>(NetowrkLocationEndPoint + "/" + CSNetID, ""));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Get the paymenthistory by ID
 /// </summary>
 /// <param name="PaymentHistoryID">Unique identifier for the PaymentHistory</param>
 /// <returns>PaymentHistory Model</returns>
 public async Task <PaymentHistory> GetPaymentHistoryByID(long PaymentHistoryID)
 {
     return(await _httpService.GetAsAsync <PaymentHistory>(PaymentHistoryEndPoint + PaymentHistoryID, ""));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Returns the list of networks that belong to user.
 /// </summary>
 /// <returns>returns the network list</returns>
 public async Task <List <Network> > GetNetworkList()
 {
     return(await _httpService.GetAsAsync <List <Network> >("NetworkList", "", false, false));
 }