Exemplo n.º 1
0
        //public string ApiCreateUser(string login, string pass, string TID, string regIP, string gender, string country, DateTime dateOfBirth, string nick, string timezone, string name, string lastName, string phone, string albPhone, string city, string address, string email, string AffiliateID)
        //{
        //    string strMdD5 = hashMD5.Fundist_Hash(login, pass, TID);
        //    using (var client = new HttpClient())
        //    {
        //        client.BaseAddress = new Uri(URL_API_FUNDIST);
        //        client.DefaultRequestHeaders.Accept.Clear();
        //        client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
        //        HttpResponseMessage response = client.GetAsync("System/Api/" + API_KEY + "/User/Add/?Login="******"&Password="******"&Currency=" + CURRENCY + "&Hash=" + strMdD5 + "&Language=" + LANGUAGE + "&RegistrationIP=" + regIP + "&Gender=" + gender + "&Country=" + country + "&DateOfBirth=" + dateOfBirth + "&Nick=" + nick + "&Timezone=" + timezone + "&Name=" + name + "&LastName=" + lastName + "&Phone=" + phone + "&AlternativePhone=" + albPhone + "&City=" + city + "&Address=" + address + "&Email=" + email + "&AffiliateID=" + AffiliateID).Result;
        //        if (response.IsSuccessStatusCode)
        //        {

        //            return response.Content.ReadAsStringAsync().Result;
        //        }
        //        return null;
        //    }
        //}
        //public string ApiCreateUser(string login, string pass, string TID, string regIP)
        //{
        //    string strMdD5 = hashMD5.Fundist_Hash(login, pass, TID);
        //    using (var client = new HttpClient())
        //    {
        //        client.BaseAddress = new Uri(URL_API_FUNDIST);
        //        client.DefaultRequestHeaders.Accept.Clear();
        //        client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
        //        HttpResponseMessage response = client.GetAsync("System/Api/" + API_KEY + "/User/Add/?Login="******"&Password="******"&Currency=" + CURRENCY + "&Hash=" + strMdD5 + "&Language=" + LANGUAGE + "&RegistrationIP=" + regIP).Result;
        //        if (response.IsSuccessStatusCode)
        //        {

        //            return response.Content.ReadAsStringAsync().Result;
        //        }
        //        return null;
        //    }
        //}
        /// <summary>
        /// Update User Infor
        /// Hash MD5: User/Update/[CASINO_SERVER_IP]/[TID]/[KEY]/[LOGIN]/[PASSWORD]/[CURRENCY]/[PWD]
        /// </summary>
        /// <param name="login"></param>
        /// <param name="pass"></param>
        /// <param name="TID"></param>
        /// <param name="regIP"></param>
        /// <param name="gender"></param>
        /// <param name="country"></param>
        /// <param name="dateOfBirth"></param>
        /// <param name="nick"></param>
        /// <param name="timezone"></param>
        /// <param name="name"></param>
        /// <param name="lastName"></param>
        /// <param name="phone"></param>
        /// <param name="albPhone"></param>
        /// <param name="city"></param>
        /// <param name="address"></param>
        /// <param name="email"></param>
        /// <param name="AffiliateID"></param>
        /// <returns></returns>
        public string ApiUpdateUserInfo(string login, string pass, string TID, string regIP, string gender, string country, DateTime dateOfBirth, string nick, string timezone, string name, string lastName, string phone, string albPhone, string city, string address, string email, string AffiliateID)
        {
            string strMdD5 = hashMD5.HashUpdateUserInfo(login, pass, TID);

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(URL_API_FUNDIST);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
                HttpResponseMessage response = client.GetAsync("System/Api/" + API_KEY + "/User/Add/?&Login="******"&Password="******"&Currency=" + CURRENCY + "&Hash=" + strMdD5 + "&Language=" + LANGUAGE + "&RegistrationIP=" + regIP + "&Gender=" + gender + "&Country=" + country + "&DateOfBirth=" + dateOfBirth + "&Nick=" + nick + "&Timezone=" + timezone + "&Name=" + name + "&LastName=" + lastName + "&Phone=" + phone + "&AlternativePhone=" + albPhone + "&City=" + city + "&Address=" + address + "&Email=" + email + "&AffiliateID=" + AffiliateID).Result;
                if (response.IsSuccessStatusCode)
                {
                    return(response.Content.ReadAsStringAsync().Result);
                }
                return(null);
            }
        }