コード例 #1
0
        public bool IsUpdateable(DataJuggler.Net5.DataRow Row)
        {
            // Initial Value
            bool updateable = false;

            // Check If There Is A PrimaryKey
            DataJuggler.Net5.DataField PrimaryKey = Row.PrimaryKey();

            // Check If PrimaryKey Exists
            if (PrimaryKey.FieldName == "void")
            {
                // Not Updateable
                updateable = false;
            }
            else
            {
                // Check If PrimaryKey Has A Value
                // If It Does Have A Value Then It Is Updateable
                // Else It Is Not
                updateable = PrimaryKey.HasValue();
            }

            // return value
            return(updateable);
        }
コード例 #2
0
        public string BuildFieldClause(DataJuggler.Net5.DataRow FieldRow, DataJuggler.Net5.DataField Field, int FieldCount)
        {
            // if FieldCount > 0
            StringBuilder sb = new StringBuilder();

            // If FieldCount > 0
            if (FieldCount > 1)
            {
                // Append The Word And
                sb.Append(" And ");
            }

            // Append fieldName
            sb.Append(Field.FieldName);
            sb.Append(" = ");

            // If This Is Not Numeric Data Add Single Quote '
            if (!FieldRow.IsNumericDataType(Field.DataType))
            {
                sb.Append("'");
            }

            // Append fieldValue
            sb.Append(Field.FieldValue);

            // If This Is Not Numeric Data Add Single Quote '
            if (!FieldRow.IsNumericDataType(Field.DataType))
            {
                sb.Append("'");
            }

            // Return New String
            return(sb.ToString());
        }