private string ProcessValue(string valueStr, string propertyStr, Type type) { PropertyInfo property = DbObjectTools.GetProperty(type, propertyStr); if (((((property.PropertyType.Equals(typeof(byte)) || property.PropertyType.Equals(typeof(sbyte))) || (property.PropertyType.Equals(typeof(short)) || property.PropertyType.Equals(typeof(ushort)))) || ((property.PropertyType.Equals(typeof(int)) || property.PropertyType.Equals(typeof(uint))) || (property.PropertyType.Equals(typeof(long)) || property.PropertyType.Equals(typeof(ulong))))) || ((property.PropertyType.Equals(typeof(char)) || property.PropertyType.Equals(typeof(float))) || property.PropertyType.Equals(typeof(double)))) || property.PropertyType.Equals(typeof(decimal))) { return(valueStr); } if (property.PropertyType.Equals(typeof(bool))) { if ("TRUE".Equals(valueStr.ToUpper())) { return("1"); } if ("1".Equals(valueStr)) { return("1"); } return("0"); } if ("''".Equals(valueStr)) { valueStr = ""; } else { valueStr = valueStr.Replace("''", "'"); } return("'" + this.Escape(valueStr) + "'"); }
private string ProcessProperty(string propertyStr, Type type) { PropertyInfo property = DbObjectTools.GetProperty(type, propertyStr); if (property == null) { return(null); } DataFieldAttribute dataFieldAttribute = DbObjectTools.GetDataFieldAttribute(property); if (dataFieldAttribute == null) { return(null); } return(dataFieldAttribute.DataFieldName); }