For the first time:
Each customer has own environment - e.g. sql server connections - and configuration. Before work, it's necessary to setup environment configuration for these particular customer.
There is database first approach.
Change data
Apply db changes into model and also into database local database
There are many 'databases'. Each 'database' has own database context in generated C# ORM models. Each such database and context has own directory e.g. DatabaseDD for data which are responsible for daily reports. It's possible that some database entities are in more such contexts. E.g. vehicles are in many databases. It's also possible include one context into another. There is DatabaseCore and most of other databases includes this 'core'.
When we made some changes in database table, stored procedure, view, which are in many 'databases', it's necessary to apply these changes to all these contexts and database classes.
Apply db changes:
Classes are generate according dcfg configurations via sqlmetal Microsoft tool.
deploy db changes to particular SQL server (testing, production):
Changes in database structure are made through update scripts. These are stored in db tables 'upgrades' tables e.g. 'DatabaseUpgrade' for core tables, KADatabaseUpgrade for database upgrades for KA database modules etc. These tables store information about every upgrade script and when it was called. When new database deployement is started, only these update scripts which aren't in these 'upgrades' tables are processed.
Be aware, that in some cases e.g. for new customer, when customer needs some new modules e.g. all particular update scripts can be applied. So when we remove some column it's necessary to check if this one isn't used in some old update scripts.
Some customers has very special database setup, see Customers paragraph.
OnlineData, OnlineDataProcessed
OnlineData and OnlineDataProcessed are special tables for data processing. Important column is ROM. It defines observed “unit” which can send online data - table dbUnit.
Showing online data processed for particular vehicle - ROM.
select * from OnlineDataProcessed where ROM = '352094087747884' and date > '2018-10-01' and date < '2018-10-10'
It's necessary to specify minimal date interval, because table is huge and queries can timeout.
Important table, columns:
Copying data from one onlinedata database to another, see more information on raltra wiki
There is special fetching process in code. Sometimes it's necessary to add columns into online data database from the OnlineDataColumns table, it's processed via stored procedures
exec CreateOnlineDataColumn 'CentralBroom' exec CreateOnlineDataColumn 'LeftBroom'
It's recommended to use transactions for this execs. Each customer has own onlinedata database.
object and tables
ISUD - Old server from VPN Access Manager shrewsoft, only one session is possibe, new server - RSD via certificate, via Cisco AnyConnect. Use special 'RSD' like configuration scripts.
OLO - nothing special
AVE - no bigint is used, special branch - support/not_bigint or similar. Access - nothing special, but there is bad IP address in connection string - necessary to copy correct from dbmouse connection settings - 93.185.96.62,1434
SUSHK - nothig special
SD - has some import from SAP. See Import_SD_SAP_Step_2.proc.sql procedure. This procedure uses special ``SD_IMPORT`` like database name, which is replaced via database deployment definition in e.g. SD_TEST.dcfg. Some of imports from SD are also make via xml transformations and DbMouse design diagrams.
features
Application/PSASWeb/FeaturesAll.ftr, will be visible for all applicationsApplication/Configuration/isud/features.ftrBuilds are on VSTS in tab “Builds and releases”. Error in builds are mostly linked into task with “link” icon.
Deploy to particular customer:
Reports are based on DevExpress reports with extension in Visual Studio. Reports when you click on report file e.g. ReportUserRights.cs. Dialog designer will be opened. Set No to question about converting binding to expression. All report components, including data bindings, detail bond e.g. are pulled from the Toolbox Palet in designer into main report.
Each time, we make some changes in report project, doesn't matter if in code or design. It's necessary to rebuild the particular report project, because each report is in own dll.
Data binding
Each report has own data connection. Mostly it's via dynamic binding. Opens the Visual Studio main menu XtraReports → Report Explorer. There is e.g. Components → binding1. Click right on binding1 and select Properties. You will see dynamic binding with BindingSource class, where property binding1.DataSource is particular class. Correct binding must be edited directly in code with line e.g. this.ManualSource.DataSource = typeof(ReportCreator.DataRow);. And then particular project must be rebuild.
When the class instance of DataRow is filled in code and in Report class result is assigned via call e.g. DataSource = ReportCreator.Create(), then the data will be dynamically transfered into report. This is mostly via some report events, which are accessible via bolt icon in Properties tab.
Some reports has data binding via designed query, some XSD files. Mostly these will be replaced with dynamic data via ReportCreator class as ORM usage inside it.
Some reports are sets as master detail e.g. ReportUserRights. These reports are bound to the class, which is master record and has some detail records. Such report has to have Detail Bond component and DetailReport and some Details, which are inserted into detail report via click right to DetailReport and select “Insert Detail Report” → detail class name.
customer-dev/Service/PSAS.LiveDataProcessor.Service.exe.config into LiveServiceProcessorService/App.Config/Integration (or ServiceTest) are grouped together in projects in PSAS_ServiceTest solution e.g ServiceTest/LiveDataProcessorPHM.Tests. Test runner can run tests parallel from different groups/projects. It means that only one test from one particular project can run once. It's used because each testing project has own database for tests, so only one test can use these database in particular time, it prevents the race conditions, locking database etc.
These are run on tfs server build server 4. Run test manually
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "c:\agent_interactive\_work\r1\a\PD1 Build Autodeployable\PD1 UI Tests\Debug\net47\GlobalTests.dll" /TestCaseFilter:"TestCategory=APL_LB&TestCategory=OpensProperlyModules&TestCategory!=Reports" /logger:"trx" /TestAdapterPath:"c:\agent_interactive\_work\r1\a\PD1 Build Autodeployable\PD1 UI Tests\"
Important part for run only particular tests.
/TestCaseFilter:"TestCategory=APL_LB&TestCategory=OpensProperlyModules&TestCategory!=Reports"
These are test for LogBook which opens page properly. But there can be problem with deployed master - it triggers the test automatically.
Jo a co jsi tam psal s tím že jsem na Tahiti a vyplňování stazky. To jsem opravdu kokot, protože vyplňuju svoz nějaké popelnici co je v Praze z počítače na Tahati, takže je jasné že bude problém.
Browsery vždycky zobrazují lokální čas podle nastavení celého počítače a jakmile by se do tohohle nativního chování začalo hrabat, tak je zaděláno na obrovské problémy naprosto všude kde pracuje v browseru s datumem a to bychom si tedy už fakt zavařili. Prostě si změním timezone v počítači na Prahu.
To už tedy posílat tu timezone klienta a ať si ty timeshifty dělá server při odesílání a ukládání dat a klienti pak uvidí to, co se děje někde v timezone dané někde nějakým nastavením na backendu pro zákazníka. Ale určitě neřešit na klientovi.
Ono do důsledku se klidně může lišit timezone jednotlivých lokalit jednoho zákazníka, nebo dokonce jednotlivých fyzických objektů - míst svozů, nádob, tras atd atd., např. v tom Maďarsku, Polsku atd atd. Takže každý “fyzický objekt” by měl mít i někde v db nastavenu timezone ale řešit by to měl server na základě timezone, co dostane od klienta.