public string AssociateAccountExists(string Email)
        {
            string          _Email = Email.ToLower();
            WcrCryptography crypto = new WcrCryptography();
            AssociateAccountExistsParameters sqlParams = new AssociateAccountExistsParameters();

            sqlParams.EmailId = crypto.WcrSimpleEncrypt(_Email);
            sqlParams.Action  = "associate";
            HttpResponseMessage resp = new HttpResponseMessage(System.Net.HttpStatusCode.BadRequest);

            using (WcrHttpClient client = new WcrHttpClient(WcrVault.Gateway.getwcrusername, WcrVault.Gateway.getwcrpassword))
            {
                resp = client.PostAsJsonAsync("api/AccountCreation/AssociateAccountExists", sqlParams).Result;
                UserAccountStatus returnModel = JsonConvert.DeserializeObject <UserAccountStatus>(resp.Content.ReadAsStringAsync().Result);
                if (returnModel == null)
                {
                    return("-1");
                }
                else
                {
                    DataSet   ds    = new DataSet("dataSet");
                    DataTable table = ds.Tables.Add("associateExists");
                    table.Columns.Add("AccountId", typeof(int));
                    table.Columns.Add("Status", typeof(int));
                    table.Columns.Add("IsEmailVerified", typeof(int));
                    DataRow dr = table.NewRow();
                    dr["AccountId"]       = returnModel.AssociateID;
                    dr["Status"]          = returnModel.Status;
                    dr["IsEmailVerified"] = returnModel.IsEmailVerified;

                    table.Rows.Add(dr);
                    return(ds.GetXml());
                }
            }
        }
Esempio n. 2
0
        public string RecordExistsOrNotForAssociate(PropAssociateRegistration objAssociateRegistration)
        {
            WcrCryptography crypto = new WcrCryptography();
            AssociateAccountExistsParameters sqlParams = new AssociateAccountExistsParameters();

            //sqlParams.EmailId = crypto.EncryptUserName(objAssociateRegistration.EmailID);
            sqlParams.EmailId = crypto.WcrSimpleEncrypt(objAssociateRegistration.EmailID);
            sqlParams.Action  = "associate";
            HttpResponseMessage resp = new HttpResponseMessage(System.Net.HttpStatusCode.BadRequest);

            using (WcrHttpClient client = new WcrHttpClient(WcrVault.Gateway.getwcrusername, WcrVault.Gateway.getwcrpassword))
            {
                resp = client.PostAsJsonAsync("api/AccountCreation/AssociateAccountExists", sqlParams).Result;

                if (resp.IsSuccessStatusCode != true)
                {
                    return(ClsCommon.InactiveValue.ToString());
                }

                WcrClassLibrary.DataObjects.UserAccountStatus returnModel = JsonConvert.DeserializeObject <WcrClassLibrary.DataObjects.UserAccountStatus>(resp.Content.ReadAsStringAsync().Result);
                if (returnModel == null)
                {
                    return(ClsCommon.InactiveValue.ToString());
                }
                else
                {
                    if (returnModel.AssociateID < 1)
                    {
                        return(ClsCommon.InactiveValue.ToString());
                    }
                    else
                    {
                        return(returnModel.AssociateID.ToString());
                    }
                }
            }
        }