Ejemplo n.º 1
0
 public override void FillIndividualPlaceholders(IEmailPerson personObject)
 {
     try
     {
         if (!(personObject is Person))
         {
             throw new ArgumentException(BaseName +
                                         ".MakeIndividualReplacements called with wrong type of person object");
         }
         Person person = (Person)personObject;
         MemberNumberWithCheck = CheckDigit.AppendCheckDigit(person.Identity).ToString();
         HexIdentifier         = person.HexIdentifier();
         MemberNumber          = person.PersonId.ToString();
         if (People.FromPhoneNumber(person.Country.Code, person.Phone).Count == 1)
         {
             MemberPhoneNumber = person.Phone;
         }
     }
     catch (Exception e)
     {
         throw new Exception(
                   "Failed in FillIndividualPlaceholders person is " + personObject == null
                 ? "null"
                 : personObject.Identity.ToString(), e);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get requested person
        try
        {
            string inputKey = HttpContext.Current.Request["Person"].ToString();
            string persId   = inputKey.Substring(1, inputKey.IndexOf("A") - 2);
            _displayedPerson = (Person)Person.FromIdentity(Convert.ToInt32(persId));
            string key = "1" + CheckDigit.AppendCheckDigit(_displayedPerson.Identity).ToString() + "A" + _displayedPerson.HexIdentifier();
            if (inputKey.ToUpper() != key.ToUpper())
            {
                throw new Exception("Wrong Call");
            }

            Subscriptions1.CurrentUserId   = _displayedPerson.Identity;
            Subscriptions1.DisplayedPerson = _displayedPerson;
            Panel2.Visible = true;
            Panel1.Visible = false;
        }
        catch
        {
            Panel1.Visible = true;
            Panel2.Visible = false;
        }
    }
Ejemplo n.º 3
0
        public override void FillIndividualPlaceholders(IEmailPerson personObject)
        {
            if (!(personObject is Person))
            {
                throw new ArgumentException(this.BaseName + ".MakeIndividualReplacements called with wrong type of person object");
            }
            Person person = (Person)personObject;

            this.MemberNumberWithCheck = CheckDigit.AppendCheckDigit(person.Identity).ToString();
            this.HexIdentifier         = person.HexIdentifier();
            this.MemberNumber          = person.PersonId.ToString();
        }
Ejemplo n.º 4
0
        public override void FillIndividualPlaceholders(IEmailPerson personObject)
        {
            if (!(personObject is Person))
            {
                throw new ArgumentException(this.BaseName + ".MakeIndividualReplacements called with wrong type of person object");
            }
            Person person = (Person)personObject;

            this.MemberNumberWithCheck = CheckDigit.AppendCheckDigit(person.Identity).ToString();
            this.HexIdentifier         = person.HexIdentifier();
            this.MemberNumber          = person.PersonId.ToString();
            this.Name           = person.Name;
            this.NameUrl        = HttpUtility.UrlEncode(person.Name);
            this.EmailBase64Url = HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(person.Mail)));
            this.PhoneBase64Url = HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(person.Phone)));
        }