コード例 #1
0
        public static string generateDeleteQuery(BaseEntitySet set, BaseEntity editEntity)
        {
            List <string> fieldsValues = editEntity.getFieldsList();
            string        query        = "delete from " + set.tableName + " where id = " + editEntity.id;

            return(query);
        }
コード例 #2
0
        public static string generateUpdateQuery(BaseEntitySet set, BaseEntity editEntity)
        {
            List <string> fieldsValues = editEntity.getFieldsList();
            string        query        = "update " + set.tableName + " set ";

            for (int i = 0; i < set.fieldNames.Count - 1; i++)
            {
                query += set.fieldNames[i] + " = '" + fieldsValues[i] + "', ";
            }
            query += set.fieldNames[set.fieldNames.Count - 1] + " = '" + fieldsValues[set.fieldNames.Count - 1] + "' where id = " + editEntity.id;

            return(query);
        }
コード例 #3
0
ファイル: EntitySetProcessor.cs プロジェクト: UCh/UChECS
        protected virtual void Init()
        {
            entities              = GetEntitySet();
            entities.NodeAdded   += internalOnNodeAdded;
            entities.NodeRemoved += internalOnNodeRemoved;

            if (entities.Count > 0)
            {
                var count = entities.Count;
                for (var i = 0; i < count; i++)
                {
                    internalOnNodeAdded(entities[i]);
                }
            }
        }
コード例 #4
0
        public static string generateInsertQuery(BaseEntitySet set, BaseEntity newEntity)
        {
            List <string> fieldsValues = newEntity.getFieldsList();
            string        query        = "insert into " + set.tableName + " (";

            for (int i = 0; i < set.fieldNames.Count - 1; i++)
            {
                query += set.fieldNames[i] + ",";
            }
            query += set.fieldNames[set.fieldNames.Count - 1] + ") values ('";

            for (int i = 0; i < fieldsValues.Count - 1; i++)
            {
                query += fieldsValues[i] + "','";
            }
            query += fieldsValues[fieldsValues.Count - 1] + "')";

            return(query);
        }