Пример #1
0
        private static string Save(DomainModel.FieldConfigurationModeXApplicationUser data, int auditId, string sqlcmd)
        {
            var sql = "EXEC ";

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

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

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeXApplicationUserId) +
                  ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId) +
                  ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeId) +
                  ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessModeId);
            return(sql);
        }
Пример #2
0
        public static DataTable GetDetails(DomainModel.FieldConfigurationModeXApplicationUser data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeXApplicationUserDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeXApplicationUserId);

            var oDT = new Framework.Components.DataAccess.DBDataTable("FieldConfigurationModeXApplicationUser.Details", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Пример #3
0
        public static void Delete(DomainModel.FieldConfigurationModeXApplicationUser data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeXApplicationUserDelete " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeXApplicationUserId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessModeId);


            Framework.Components.DataAccess.DBDML.RunSQL("FieldConfigurationModeXApplicationUser.Delete", sql, DataStoreKey);
        }
Пример #4
0
        public static DataTable SearchByFCModeAccessMode(DomainModel.FieldConfigurationModeXApplicationUser data, int auditId)
        {
            // formulate SQL
            var sql = "EXEC dbo.FieldConfigurationModeXApplicationUserSearchByFCModeAccessModeByFCModeAccessMode " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessMode);

            var oDT = new DataAccess.DBDataTable("FieldConfigurationModeXApplicationRole.Search", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Пример #5
0
        public static string ToSQLParameter(DomainModel.FieldConfigurationModeXApplicationUser data, string dataColumnName)
        {
            var returnValue = "NULL";

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

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeId:
                if (data.FieldConfigurationModeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeId, data.FieldConfigurationModeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeId);
                }
                break;

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId:
                if (data.ApplicationUserId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId, data.ApplicationUserId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUserId);
                }
                break;

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessModeId:
                if (data.FieldConfigurationModeAccessModeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessModeId, data.FieldConfigurationModeAccessModeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessModeId);
                }
                break;

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationMode:
                if (!string.IsNullOrEmpty(data.FieldConfigurationMode))
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationMode, data.FieldConfigurationMode);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationMode);
                }
                break;

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUser:
                if (!string.IsNullOrEmpty(data.ApplicationUser))
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUser, data.ApplicationUser);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.ApplicationUser);
                }
                break;

            case DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessMode:
                if (!string.IsNullOrEmpty(data.FieldConfigurationModeAccessMode))
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessMode, data.FieldConfigurationModeAccessMode);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeXApplicationUser.DataColumns.FieldConfigurationModeAccessMode);
                }
                break;

            default:
                returnValue = BaseClass.ToSQLParameter(data, dataColumnName);
                break;
            }
            return(returnValue);
        }
Пример #6
0
        public static void Update(DomainModel.FieldConfigurationModeXApplicationUser data, int auditId)
        {
            var sql = Save(data, auditId, "Update");

            Framework.Components.DataAccess.DBDML.RunSQL("FieldConfigurationModeXApplicationUser.Update", sql, DataStoreKey);
        }