case 3988

This commit is contained in:
2021-09-29 20:11:00 +00:00
parent 7ccfa01050
commit 45449a2ff3
3 changed files with 46 additions and 58 deletions

2
.vscode/launch.json vendored
View File

@@ -52,7 +52,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "false", "AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -20,8 +20,8 @@ namespace AyaNova.DataList
FieldKey = "PartPartNumber", FieldKey = "PartPartNumber",
AType = (int)AyaType.Part, AType = (int)AyaType.Part,
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apart.id", SqlIdColumnName = "id",
SqlValueColumnName = "apart.partnumber", SqlValueColumnName = "partnumber",
IsRowId = true IsRowId = true
}); });
@@ -30,7 +30,7 @@ namespace AyaNova.DataList
TKey = "PartName", TKey = "PartName",
FieldKey = "PartName", FieldKey = "PartName",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.name" SqlValueColumnName = "name"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -38,7 +38,7 @@ namespace AyaNova.DataList
TKey = "PartNotes", TKey = "PartNotes",
FieldKey = "PartNotes", FieldKey = "PartNotes",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.notes" SqlValueColumnName = "notes"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -46,7 +46,7 @@ namespace AyaNova.DataList
TKey = "Active", TKey = "Active",
FieldKey = "Active", FieldKey = "Active",
UiFieldDataType = (int)UiFieldDataType.Bool, UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "apart.active" SqlValueColumnName = "active"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -54,7 +54,7 @@ namespace AyaNova.DataList
TKey = "Tags", TKey = "Tags",
FieldKey = "Tags", FieldKey = "Tags",
UiFieldDataType = (int)UiFieldDataType.Tags, UiFieldDataType = (int)UiFieldDataType.Tags,
SqlValueColumnName = "apart.tags" SqlValueColumnName = "tags"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -62,7 +62,7 @@ namespace AyaNova.DataList
TKey = "PartCost", TKey = "PartCost",
FieldKey = "PartCost", FieldKey = "PartCost",
UiFieldDataType = (int)UiFieldDataType.Currency, UiFieldDataType = (int)UiFieldDataType.Currency,
SqlValueColumnName = "apart.cost" SqlValueColumnName = "cost"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -70,7 +70,7 @@ namespace AyaNova.DataList
TKey = "PartRetail", TKey = "PartRetail",
FieldKey = "PartRetail", FieldKey = "PartRetail",
UiFieldDataType = (int)UiFieldDataType.Currency, UiFieldDataType = (int)UiFieldDataType.Currency,
SqlValueColumnName = "apart.retail" SqlValueColumnName = "retail"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -79,8 +79,8 @@ namespace AyaNova.DataList
TKey = "PartManufacturerID", TKey = "PartManufacturerID",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
AType = (int)AyaType.Vendor, AType = (int)AyaType.Vendor,
SqlIdColumnName = "aman.id", SqlIdColumnName = "manid",
SqlValueColumnName = "aman.name" SqlValueColumnName = "manname"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -89,8 +89,8 @@ namespace AyaNova.DataList
TKey = "PartWholesalerID", TKey = "PartWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
AType = (int)AyaType.Vendor, AType = (int)AyaType.Vendor,
SqlIdColumnName = "awhole.id", SqlIdColumnName = "wholeid",
SqlValueColumnName = "awhole.name" SqlValueColumnName = "wholename"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -99,8 +99,8 @@ namespace AyaNova.DataList
TKey = "PartAlternativeWholesalerID", TKey = "PartAlternativeWholesalerID",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
AType = (int)AyaType.Vendor, AType = (int)AyaType.Vendor,
SqlIdColumnName = "aaltwhole.id", SqlIdColumnName = "altwholeid",
SqlValueColumnName = "aaltwhole.name" SqlValueColumnName = "altwholename"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -108,7 +108,7 @@ namespace AyaNova.DataList
TKey = "PartManufacturerNumber", TKey = "PartManufacturerNumber",
FieldKey = "PartManufacturerNumber", FieldKey = "PartManufacturerNumber",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.manufacturernumber" SqlValueColumnName = "manufacturernumber"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -116,7 +116,7 @@ namespace AyaNova.DataList
TKey = "PartWholesalerNumber", TKey = "PartWholesalerNumber",
FieldKey = "PartWholesalerNumber", FieldKey = "PartWholesalerNumber",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.wholesalernumber" SqlValueColumnName = "wholesalernumber"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -124,7 +124,7 @@ namespace AyaNova.DataList
TKey = "PartAlternativeWholesalerNumber", TKey = "PartAlternativeWholesalerNumber",
FieldKey = "PartAlternativeWholesalerNumber", FieldKey = "PartAlternativeWholesalerNumber",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.alternativewholesalernumber" SqlValueColumnName = "alternativewholesalernumber"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -132,7 +132,7 @@ namespace AyaNova.DataList
TKey = "UnitOfMeasure", TKey = "UnitOfMeasure",
FieldKey = "UnitOfMeasure", FieldKey = "UnitOfMeasure",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.unitofmeasure" SqlValueColumnName = "unitofmeasure"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -140,7 +140,7 @@ namespace AyaNova.DataList
TKey = "PartUPC", TKey = "PartUPC",
FieldKey = "PartUPC", FieldKey = "PartUPC",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apart.upc" SqlValueColumnName = "upc"
}); });
FieldDefinitions.Add(new DataListFieldDefinition FieldDefinitions.Add(new DataListFieldDefinition
@@ -148,25 +148,25 @@ namespace AyaNova.DataList
TKey = "PartSerialNumbersAvailable", TKey = "PartSerialNumbersAvailable",
FieldKey = "PartSerialNumbersAvailable", FieldKey = "PartSerialNumbersAvailable",
UiFieldDataType = (int)UiFieldDataType.Text, UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "(select array_to_string(array_agg(serial),', ') from apartserial where partid=apart.id group by partid) as sub_serials" SqlValueColumnName = "partserials"
}); });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom1", FieldKey = "partcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom1", FieldKey = "partcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom2", FieldKey = "partcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom2", FieldKey = "partcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom3", FieldKey = "partcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom3", FieldKey = "partcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom4", FieldKey = "partcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom4", FieldKey = "partcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom5", FieldKey = "partcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom5", FieldKey = "partcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom6", FieldKey = "partcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom6", FieldKey = "partcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom7", FieldKey = "partcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom7", FieldKey = "partcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom8", FieldKey = "partcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom8", FieldKey = "partcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom9", FieldKey = "partcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom9", FieldKey = "partcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom10", FieldKey = "partcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom10", FieldKey = "partcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom11", FieldKey = "partcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom11", FieldKey = "partcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom12", FieldKey = "partcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom12", FieldKey = "partcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom13", FieldKey = "partcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom13", FieldKey = "partcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom14", FieldKey = "partcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom14", FieldKey = "partcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom15", FieldKey = "partcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom15", FieldKey = "partcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom16", FieldKey = "partcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" }); FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom16", FieldKey = "partcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "customfields" });
} }
}//eoc }//eoc
}//eons }//eons

View File

@@ -22,16 +22,16 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 1; private const int DESIRED_SCHEMA_LEVEL = 1;
internal const long EXPECTED_COLUMN_COUNT = 1277; internal const long EXPECTED_COLUMN_COUNT = 1302;
internal const long EXPECTED_INDEX_COUNT = 145; internal const long EXPECTED_INDEX_COUNT = 145;
internal const long EXPECTED_CHECK_CONSTRAINTS = 518; internal const long EXPECTED_CHECK_CONSTRAINTS = 518;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 193; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 193;
internal const long EXPECTED_VIEWS = 10; internal const long EXPECTED_VIEWS = 11;
internal const long EXPECTED_ROUTINES = 2; internal const long EXPECTED_ROUTINES = 2;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
///////////////////////////////////////////////////////////////// (C1277:I145:CC518:FC193:V10:R2) ///////////////////////////////////////////////////////////////// C1302:I145:CC518:FC193:V11:R2
/* /*
@@ -1196,24 +1196,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await SetSchemaLevelAsync(++currentSchema); await SetSchemaLevelAsync(++currentSchema);
//PART DATA LIST VIEW //PART DATA LIST VIEW
/* //required to include serials from partserials table
CREATE OR REPLACE VIEW viewpartsdatalist AS SELECT APART.*, await ExecQueryAsync("CREATE OR REPLACE VIEW viewpartsdatalist AS SELECT APART.*, AMAN.NAME AS MANNAME, AMAN.ID AS MANID, AWHOLE.NAME AS WHOLENAME,AWHOLE.ID AS WHOLEID, "
AMAN.NAME AS MANNAME, + "AALTWHOLE.NAME AS ALTWHOLENAME, AALTWHOLE.ID AS ALTWHOLEID, (SELECT ARRAY_TO_STRING(ARRAY_AGG(serial),', ') FROM APARTSERIAL WHERE PARTID = APART.ID GROUP BY PARTID) AS PARTSERIALS "
AMAN.ID AS MANID, + "FROM APART LEFT JOIN AVENDOR AS AMAN ON (APART.MANUFACTURERID = AMAN.ID) LEFT JOIN AVENDOR AS AWHOLE ON (APART.WHOLESALERID = AWHOLE.ID) LEFT JOIN AVENDOR AS AALTWHOLE ON (APART.ALTERNATIVEWHOLESALERID = AALTWHOLE.ID)");
AWHOLE.NAME AS WHOLENAME,
AWHOLE.ID AS WHOLEID,
AALTWHOLE.NAME AS ALTWHOLENAME,
AALTWHOLE.ID AS ALTWHOLEID,
(SELECT ARRAY_TO_STRING(ARRAY_AGG(serial),', ')
FROM APARTSERIAL
WHERE PARTID = APART.ID
GROUP BY PARTID) AS PARTSERIALS
FROM APART
LEFT JOIN AVENDOR AS AMAN ON (APART.MANUFACTURERID = AMAN.ID)
LEFT JOIN AVENDOR AS AWHOLE ON (APART.WHOLESALERID = AWHOLE.ID)
LEFT JOIN AVENDOR AS AALTWHOLE ON (APART.ALTERNATIVEWHOLESALERID = AALTWHOLE.ID)
*/
//SCHEDULE VIEWS //SCHEDULE VIEWS