コード例 #1
0
 void ICreditCard.AddParametersToRequest(RestRequest request)
 {
     request.AddParameter("card[number]", Number);
     request.AddParameter("card[exp_month]", ExpMonth);
     request.AddParameter("card[exp_year]", ExpYear);
     if (Cvc.HasValue())
     {
         request.AddParameter("card[cvc]", Cvc);
     }
     if (Name.HasValue())
     {
         request.AddParameter("card[name]", Name);
     }
     if (AddressLine1.HasValue())
     {
         request.AddParameter("card[address_line1]", AddressLine1);
     }
     if (AddressLine2.HasValue())
     {
         request.AddParameter("card[address_line2]", AddressLine2);
     }
     if (AddressZip.HasValue())
     {
         request.AddParameter("card[address_zip]", AddressZip);
     }
     if (AddressState.HasValue())
     {
         request.AddParameter("card[address_state]", AddressState);
     }
     if (AddressCountry.HasValue())
     {
         request.AddParameter("card[address_country]", AddressCountry);
     }
 }
コード例 #2
0
 void IObjectValidation.AddParametersToRequest(RestRequest request)
 {
     if (Token.HasValue())
     {
         request.AddParameter("source", Token);
     }
     else
     {
         request.AddParameter("source[object]", "card");
         request.AddParameter("source[number]", Number);
         request.AddParameter("source[exp_month]", ExpMonth);
         request.AddParameter("source[exp_year]", ExpYear);
         if (Cvc.HasValue())
         {
             request.AddParameter("source[cvc]", Cvc);
         }
         if (Name.HasValue())
         {
             request.AddParameter("source[name]", Name);
         }
         if (AddressLine1.HasValue())
         {
             request.AddParameter("source[address_line1]", AddressLine1);
         }
         if (AddressLine2.HasValue())
         {
             request.AddParameter("source[address_line2]", AddressLine2);
         }
         if (AddressCity.HasValue())
         {
             request.AddParameter("source[address_city]", AddressCity);
         }
         if (AddressState.HasValue())
         {
             request.AddParameter("source[address_state]", AddressState);
         }
         if (AddressZip.HasValue())
         {
             request.AddParameter("source[address_zip]", AddressZip);
         }
         if (AddressCountry.HasValue())
         {
             request.AddParameter("source[address_country]", AddressCountry);
         }
     }
 }
コード例 #3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(base.ToString());

            sb.Append("USR");

            if (IsOnline.HasValue)
            {
                sb.AppendFormat("-A{0}", IsOnline.Value ? "1" : "0");
            }

            if (!string.IsNullOrEmpty(Vorname))
            {
                sb.AppendFormat("-B{0}", Vorname.ToLower());
            }

            if (!string.IsNullOrEmpty(Name))
            {
                sb.AppendFormat("-C{0}", Name.ToLower());
            }

            if (!string.IsNullOrEmpty(Sex))
            {
                sb.AppendFormat("-D{0}", Sex.ToLower());
            }

            if (!string.IsNullOrEmpty(RelationStatus))
            {
                sb.AppendFormat("-E{0}", RelationStatus.ToLower());
            }

            if (!string.IsNullOrEmpty(AttractedTo))
            {
                sb.AppendFormat("-F{0}", AttractedTo.ToLower());
            }

            if (!string.IsNullOrEmpty(EyeColor))
            {
                sb.AppendFormat("-G{0}", EyeColor.ToLower());
            }

            if (!string.IsNullOrEmpty(HairColor))
            {
                sb.AppendFormat("-H{0}", HairColor.ToLower());
            }

            if (BodyHeightFrom.HasValue)
            {
                sb.AppendFormat("-I{0}", BodyHeightFrom.Value);
            }

            if (BodyHeightTo.HasValue)
            {
                sb.AppendFormat("-J{0}", BodyHeightTo.Value);
            }

            if (BodyWeightFrom.HasValue)
            {
                sb.AppendFormat("-K{0}", BodyWeightFrom.Value);
            }

            if (BodyWeightTo.HasValue)
            {
                sb.AppendFormat("-L{0}", BodyWeightTo.Value);
            }

            if (AgeFrom.HasValue)
            {
                sb.AppendFormat("-M{0}", AgeFrom.Value);
            }

            if (AgeTo.HasValue)
            {
                sb.AppendFormat("-N{0}", AgeTo.Value);
            }

            if (CommunityIDMember.HasValue)
            {
                sb.AppendFormat("-O{0}", CommunityIDMember.Value);
            }

            if (!string.IsNullOrEmpty(AddressCity))
            {
                sb.AppendFormat("-P{0}", AddressCity.ToLower());
            }

            if (!string.IsNullOrEmpty(AddressZip))
            {
                sb.AppendFormat("-Q{0}", AddressZip.ToLower());
            }

            if (!string.IsNullOrEmpty(AddressLand))
            {
                sb.AppendFormat("-R0}", AddressLand.ToLower());
            }

            if (AddressRangeKM.HasValue)
            {
                sb.AppendFormat("-S{0}", AddressRangeKM.Value);
            }

            if (!string.IsNullOrEmpty(InterestTopic))
            {
                sb.AppendFormat("-T0}", InterestTopic.ToLower());
            }

            if (!string.IsNullOrEmpty(Interesst))
            {
                sb.AppendFormat("-U0}", Interesst.ToLower());
            }

            if (!string.IsNullOrEmpty(Talent))
            {
                sb.AppendFormat("-V0}", Talent.ToLower());
            }

            if (ForObjectType.HasValue)
            {
                sb.AppendFormat("-W{0}", ForObjectType.Value);
            }

            if (LoadVisits.HasValue)
            {
                sb.AppendFormat("-X{0}", LoadVisits.Value ? "1" : "0");
            }

            return(sb.ToString());
        }