Exemple #1
0
        public string setRegistrationInformation(RegistrationModel registrationModel, string propName, string propValue)
        {
            Type myType = registrationModel.GetType();
            IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties());
            string ObjectData          = string.Empty;

            foreach (PropertyInfo prop in props)
            {
                if (prop.Name.Equals(propName, StringComparison.OrdinalIgnoreCase))
                {
                    prop.SetValue(registrationModel, Convert.ChangeType(propValue, prop.PropertyType));
                    break;
                }
                else
                {
                    continue;
                }
            }
            return(ObjectData);
        }
Exemple #2
0
        public string getRegistrationInformation(RegistrationModel registrationModel)
        {
            Type myType = registrationModel.GetType();
            IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties());
            string ObjectData          = string.Empty;

            foreach (PropertyInfo prop in props)
            {
                object propValue = prop.GetValue(registrationModel, null);
                if (!string.IsNullOrWhiteSpace(ObjectData))
                {
                    ObjectData = ObjectData + "|" + Encrypt(prop.Name + "@" + Convert.ToString(propValue));
                }
                else
                {
                    ObjectData = Encrypt(prop.Name + "@" + propValue.ToString());
                }
            }
            return(ObjectData);
        }