protected override string CastToImp(NumberSqlLiteralType sqlLiteralType, object propertyValue) { long ret = 0; //数値に変換できない場合は0を返す long.TryParse(propertyValue.ToString(), out ret); return(ret.ToString()); }
//Public Overloads Function BeforeCast(ByVal sqlLiteralType As StringSqlLiteralType, _ // ByVal propertyType As StringPropertyType, _ // ByVal aColumnInfo As ColumnInfo, _ // ByVal propertyValue As Object) As Object // Return JkCastEditor.FillWithDefaultValue(propertyValue, aColumnInfo) //End Function public object BeforeCast(NumberSqlLiteralType sqlLiteralType , StringPropertyType propertyType , ColumnInfo aColumnInfo , object propertyValue) { string numStr = (string)propertyValue; decimal dec = default(decimal); decimal.TryParse(numStr, out dec); return(dec.ToString()); }
protected override string CastToImp(NumberSqlLiteralType sqlLiteralType, object propertyValue) { bool b = (bool)propertyValue; if (b) { return("1"); } else { return("0"); } }
protected override string CastToImp(NumberSqlLiteralType sqlLiteralType, object propertyValue) { return(propertyValue.ToString()); }
protected override string CastToImp(NumberSqlLiteralType sqlLiteralType, object propertyValue) { System.DateTime d = (System.DateTime)propertyValue; return(d.ToString("yyyyMMdd").TrimStart('0')); }