Exemple #1
0
        public static string ToSQLParameter(FieldConfigurationModeCategoryXFCModeDataModel data, string dataColumnName)
        {
            var returnValue = "NULL";

            switch (dataColumnName)
            {
            case FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeCategoryXFCModeId:
                if (data.FieldConfigurationModeCategoryXFCModeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeCategoryXFCModeId, data.FieldConfigurationModeCategoryXFCModeId);
                }

                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeCategoryXFCModeId);
                }
                break;

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

            case FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeId:
                if (data.FieldConfigurationModeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeId, data.FieldConfigurationModeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FieldConfigurationModeCategoryXFCModeDataModel.DataColumns.FieldConfigurationModeId);
                }
                break;
            }
            return(returnValue);
        }
Exemple #2
0
        public static List <FieldConfigurationModeCategoryXFCModeDataModel> GetEntityDetails(FieldConfigurationModeCategoryXFCModeDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.FieldConfigurationModeCategoryXFCModeSearch ";

            var parameters =
                new
            {
                AuditId           = requestProfile.AuditId
                , ApplicationId   = requestProfile.ApplicationId
                , ApplicationMode = requestProfile.ApplicationModeId
                , ReturnAuditInfo = returnAuditInfo
                , FieldConfigurationModeCategoryId = dataQuery.FieldConfigurationModeCategoryId
                , FieldConfigurationModeId         = dataQuery.FieldConfigurationModeId
            };

            List <FieldConfigurationModeCategoryXFCModeDataModel> result;

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                result = dataAccess.Connection.Query <FieldConfigurationModeCategoryXFCModeDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList();
            }

            return(result);
        }