Esempio n. 1
0
        public static List <DomainModel.FieldConfigurationModeCategory> GetEntityDetails(DomainModel.FieldConfigurationModeCategory data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeCategoryDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId);

            var result = new List <DomainModel.FieldConfigurationModeCategory>();

            using (var reader = new DBDataReader("Get Details", sql, DataStoreKey))
            {
                var dbReader = reader.DBReader;

                while (dbReader.Read())
                {
                    var dataItem = new DomainModel.FieldConfigurationModeCategory();

                    dataItem.FieldConfigurationModeCategoryId = (int)dbReader[DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId];

                    SetStandardInfo(dataItem, dbReader);

                    //SetBaseInfo(dataItem, dbReader);
                    result.Add(dataItem);
                }
            }

            return(result);
        }
Esempio n. 2
0
        private static string Save(DomainModel.FieldConfigurationModeCategory data, int auditId, string sqlcmd)
        {
            var sql = "EXEC ";

            switch (sqlcmd)
            {
            case "Create":
                sql += "dbo.FieldConfigurationModeCategoryInsert  " +
                       " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                       ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId);
                break;

            case "Update":
                sql += "dbo.FieldConfigurationModeCategoryUpdate  " +
                       " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                       ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId);
                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.SortOrder);
            return(sql);
        }
Esempio n. 3
0
        public static void Delete(DomainModel.FieldConfigurationModeCategory data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeCategoryDelete " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId);

            DataAccess.DBDML.RunSQL("FieldConfigurationModeCategory.Delete", sql, DataStoreKey);
        }
Esempio n. 4
0
        public static DataTable GetDetails(DomainModel.FieldConfigurationModeCategory data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeCategoryDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId);

            var oDT = new DataAccess.DBDataTable("FieldConfigurationModeCategory.Details", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Esempio n. 5
0
        public static DataTable DoesExist(DomainModel.FieldConfigurationModeCategory data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeCategoryDoesExist " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId) +
                      ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId);

            var oDT = new DataAccess.DBDataTable("FieldConfigurationModeCategory.DoesExist", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Esempio n. 6
0
        public static string ToSQLParameter(DomainModel.FieldConfigurationModeCategory data, string dataColumnName)
        {
            var returnValue = "NULL";

            switch (dataColumnName)
            {
            case DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId:
                if (data.FieldConfigurationModeCategoryId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId, data.FieldConfigurationModeCategoryId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeCategory.DataColumns.FieldConfigurationModeCategoryId);
                }
                break;

            default:
                returnValue = StandardClass.ToSQLParameter(data, dataColumnName);
                break;
            }

            return(returnValue);
        }
Esempio n. 7
0
        public static void Create(DomainModel.FieldConfigurationModeCategory data, int auditId)
        {
            var sql = Save(data, auditId, "Create");

            DataAccess.DBDML.RunSQL("FieldConfigurationModeCategory.Insert", sql, DataStoreKey);
        }