Пример #1
0
 protected void btnLookUp_Click(object sender, EventArgs e)
 {
     try
     {
         HarperMembershipService.BaseResponse response = MembershipClient.GetMemberBySFGId(Cryptography.Hash(txtMemberId.Text.Trim().Replace("-", "").Replace(" ", ""), true));
         MemberResponse = response.TypedResponse as HarperMembershipService.GetMemberResponse;
         string sfg_zip = MemberResponse.MemberData.Address.PostalCode;
         if (sfg_zip.Contains("-"))
         {
             sfg_zip = sfg_zip.Split('-')[0];
         }
         string mbr_zip = txtZip.Text.Trim();
         if (mbr_zip.Contains("-"))
         {
             mbr_zip = mbr_zip.Split('-')[0];
         }
         if (sfg_zip == mbr_zip && MemberResponse.MemberData.MemberId.Length > 0)
         {
             Session["MemberId"] = Cryptography.Hash(MemberResponse.MemberData.MemberId, true);
             Session["Zip"]      = Cryptography.Hash(txtZip.Text.Trim().Replace("-", "").Replace(" ", ""), true);
             Response.Redirect("UserConfirm.aspx", false);
         }
         else
         {
             SetError(new Exception("Zip code doesn't match or SFG id is empty"));
         }
     }
     catch (Exception ex)
     {
         SetError(ex);
     }
 }
Пример #2
0
 protected void PopulateForm()
 {
     try
     {
         HarperMembershipService.BaseResponse response = MembershipClient.GetMemberBySFGId(Cryptography.Hash(CustomerID, true));
         MemberResponse            = response.TypedResponse as HarperMembershipService.GetMemberResponse;
         Session["MemberResponse"] = MemberResponse;
         if (!MemberResponse.WebAccountFound || CustomerID == "10001636220")//the check on customer id (mcoupland) was put in so Agatha could step through the process and style the pages
         {
             lblPassport.Text  = MemberResponse.MemberData.MemberId;
             lblFirstName.Text = MemberResponse.MemberData.FirstName;
             lblLastName.Text  = MemberResponse.MemberData.LastName;
             lblAddress1.Text  = MemberResponse.MemberData.Address.Address1;
             lblAddress2.Text  = MemberResponse.MemberData.Address.Address2;
             lblCity.Text      = MemberResponse.MemberData.Address.City;
             lblZip.Text       = MemberResponse.MemberData.Address.PostalCode;
         }
         else
         {
             SetError(new Exception(string.Format("Unable to create username. Member id {0} already has a username at SFG.", MemberResponse.MemberData.MemberId)));
             lblMessage.Text    = string.Format("We encountered an error while trying to create your username.<br />{0}<br /><br />{1}", new object[] { "A user account has already been created for this member number.", Resources.GlobalStrings.ContactUs });
             lblMessage.Visible = true;
         }
     }
     catch (Exception e)
     {
         SetError(e);
     }
 }