コード例 #1
0
        public static Guid CreateField(Guid id, string name, string displayName, string description, string defaultValue, Guid entityId, int fieldTypeId, bool isRequired, int stateId)
        {
            var returnValue = SharedService.ExecutePostSqlStoredProcedure("[eduq].[Field_create]",
                                                                          new List <SqlParameter> {
                new SqlParameter("@id", id),
                new SqlParameter("@name", name),
                new SqlParameter("@displayName", displayName),
                new SqlParameter("@description", description),
                new SqlParameter("@defaultValue", defaultValue),
                new SqlParameter("@entityId", entityId),
                new SqlParameter("@fieldTypeId", fieldTypeId),
                new SqlParameter("@isRequired", isRequired),
                new SqlParameter("@stateId", stateId)
            });

            if (returnValue != 1)
            {
                return(Guid.Empty);
            }
            var newlyCreatedField = QueryFieldById(id);

            if (newlyCreatedField == null || newlyCreatedField.Count == 0)
            {
                return(Guid.Empty);
            }
            var newlyCreatedFieldId = newlyCreatedField.FirstOrDefault(x => x.Key == "Id");

            if (newlyCreatedField == null)
            {
                return(Guid.Empty);
            }
            return(Guid.Parse(newlyCreatedFieldId.Value.ToString()));
        }
コード例 #2
0
ファイル: SqlService.cs プロジェクト: tshibangumike/Eduq_Dev
        public static bool CreateSqlTable(string tableName)
        {
            var returnValue = SharedService.ExecutePostSqlStoredProcedure("[eduq].[Sql_createsqltable]",
                                                                          new List <SqlParameter>
            {
                new SqlParameter("@tableName", tableName)
            });

            return(returnValue == 1);
        }
コード例 #3
0
ファイル: SqlService.cs プロジェクト: tshibangumike/Eduq_Dev
        public static bool DeleteSqlTableColumn(string tableName, string columnName)
        {
            var returnValue = SharedService.ExecutePostSqlStoredProcedure("[eduq].[Sql_deletesqltablecolumn]",
                                                                          new List <SqlParameter>
            {
                new SqlParameter("@tableName", tableName),
                new SqlParameter("@columnName", columnName)
            });

            return(returnValue == 1);
        }
コード例 #4
0
ファイル: SqlService.cs プロジェクト: tshibangumike/Eduq_Dev
        public static bool CreateSqlForeignKeyConstraint(string tableName, string foreignKeyTableName, string columnName)
        {
            var returnValue = SharedService.ExecutePostSqlStoredProcedure("[eduq].[Sql_createsqlforeignkeycontraint]",
                                                                          new List <SqlParameter>
            {
                new SqlParameter("@tableName", tableName),
                new SqlParameter("@foreignKeyTableName", foreignKeyTableName),
                new SqlParameter("@columnName", columnName)
            });

            return(returnValue == 1);
        }
コード例 #5
0
ファイル: SqlService.cs プロジェクト: tshibangumike/Eduq_Dev
        public static bool CreateSqlTableColumn(string tableName, string columnName, string dataTypeName, string isRequired)
        {
            var returnValue = SharedService.ExecutePostSqlStoredProcedure("[eduq].[Sql_createsqltablecolumn]",
                                                                          new List <SqlParameter>
            {
                new SqlParameter("@tableName", tableName),
                new SqlParameter("@columnName", columnName),
                new SqlParameter("@columnDataTypeName", dataTypeName),
                new SqlParameter("@isRequired", isRequired)
            });

            return(returnValue == 1);
        }