Version 0.3.0 Client release
This commit is contained in:
parent
d09ca5bb8a
commit
699552e23c
2
.gitignore
vendored
2
.gitignore
vendored
@ -225,7 +225,7 @@ publish/
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
# *.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
|
||||
1009
misc/BreCalApi.cs
1009
misc/BreCalApi.cs
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
openapi: '3.0.0'
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: '0.2.0'
|
||||
title: 'Bremen calling API'
|
||||
version: "0.3.0"
|
||||
title: "Bremen calling API"
|
||||
description: Administer DEBRE ship calls, times and notifications
|
||||
termsOfService: "https://www.bsmd.de/" # url to terms page
|
||||
contact:
|
||||
@ -28,22 +28,42 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/credentials'
|
||||
$ref: "#/components/schemas/credentials"
|
||||
responses:
|
||||
200:
|
||||
description: Successful response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/login_result'
|
||||
$ref: "#/components/schemas/login_result"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
403:
|
||||
$ref: '#/components/responses/403'
|
||||
$ref: "#/components/responses/403"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/user:
|
||||
put:
|
||||
summary: Update user details (first/last name, phone, password)
|
||||
requestBody:
|
||||
description: User details
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/user_details"
|
||||
responses:
|
||||
400:
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/shipcalls:
|
||||
get:
|
||||
@ -61,15 +81,15 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/shipcalls'
|
||||
$ref: "#/components/schemas/shipcalls"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
post:
|
||||
summary: Create a new ship call
|
||||
requestBody:
|
||||
@ -78,16 +98,16 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/shipcall'
|
||||
$ref: "#/components/schemas/shipcall"
|
||||
responses:
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
put:
|
||||
summary: Updates a ship call
|
||||
@ -97,16 +117,16 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/shipcall'
|
||||
$ref: "#/components/schemas/shipcall"
|
||||
responses:
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/ships:
|
||||
get:
|
||||
@ -117,15 +137,15 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ship_list'
|
||||
$ref: "#/components/schemas/ship_list"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/participants:
|
||||
get:
|
||||
@ -143,17 +163,17 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/participant_list'
|
||||
$ref: "#/components/schemas/participant_list"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
404:
|
||||
$ref: '#/components/responses/404'
|
||||
$ref: "#/components/responses/404"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/times:
|
||||
get:
|
||||
@ -170,15 +190,15 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/times_list'
|
||||
$ref: "#/components/schemas/times_list"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
post:
|
||||
summary: Create a new times entry for a ship call
|
||||
@ -188,16 +208,16 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/times'
|
||||
$ref: "#/components/schemas/times"
|
||||
responses:
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
put:
|
||||
summary: Update a times entry for a ship call
|
||||
@ -207,16 +227,16 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/times'
|
||||
$ref: "#/components/schemas/times"
|
||||
responses:
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
delete:
|
||||
summary: Delete a times entry for a ship call.
|
||||
@ -225,16 +245,16 @@ paths:
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/components/schemas/timesId'
|
||||
$ref: "#/components/schemas/timesId"
|
||||
responses:
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
|
||||
/notifications:
|
||||
get:
|
||||
@ -251,22 +271,22 @@ paths:
|
||||
required: true
|
||||
description: "**Id of ship call**. *Example: 52*. Id given in ship call list"
|
||||
schema:
|
||||
$ref: '#/components/schemas/shipcallId'
|
||||
$ref: "#/components/schemas/shipcallId"
|
||||
responses:
|
||||
200:
|
||||
description: notification list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/notification'
|
||||
$ref: "#/components/schemas/notification"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
/berths:
|
||||
get:
|
||||
summary: Gets a list of all berths registered
|
||||
@ -276,15 +296,15 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/berth_list'
|
||||
$ref: "#/components/schemas/berth_list"
|
||||
400:
|
||||
$ref: '#/components/responses/400'
|
||||
$ref: "#/components/responses/400"
|
||||
401:
|
||||
$ref: '#/components/responses/401'
|
||||
$ref: "#/components/responses/401"
|
||||
500:
|
||||
$ref: '#/components/responses/500'
|
||||
$ref: "#/components/responses/500"
|
||||
503:
|
||||
$ref: '#/components/responses/503'
|
||||
$ref: "#/components/responses/503"
|
||||
components:
|
||||
schemas:
|
||||
credentials:
|
||||
@ -294,9 +314,10 @@ components:
|
||||
- password
|
||||
properties:
|
||||
username:
|
||||
format : string
|
||||
type: string
|
||||
password:
|
||||
format : string
|
||||
type: string
|
||||
format: password
|
||||
timesId:
|
||||
description: The unique identifier for a times entry
|
||||
type: integer
|
||||
@ -310,11 +331,9 @@ components:
|
||||
- ship_id
|
||||
- type
|
||||
- eta
|
||||
- voyage
|
||||
- etd
|
||||
properties:
|
||||
id:
|
||||
$ref: '#/components/schemas/shipcallId'
|
||||
$ref: "#/components/schemas/shipcallId"
|
||||
ship_id:
|
||||
type: integer
|
||||
type:
|
||||
@ -328,6 +347,7 @@ components:
|
||||
format: date-time
|
||||
voyage:
|
||||
type: string
|
||||
maxLength: 16
|
||||
nullable: true
|
||||
etd:
|
||||
type: string
|
||||
@ -354,7 +374,10 @@ components:
|
||||
bunkering:
|
||||
type: boolean
|
||||
nullable: true
|
||||
replenishing:
|
||||
replenishing_terminal:
|
||||
type: boolean
|
||||
nullable: true
|
||||
replenishing_lock:
|
||||
type: boolean
|
||||
nullable: true
|
||||
draft:
|
||||
@ -375,6 +398,15 @@ components:
|
||||
recommended_tugs:
|
||||
type: integer
|
||||
nullable: true
|
||||
anchored:
|
||||
type: boolean
|
||||
nullable: true
|
||||
moored_lock:
|
||||
type: boolean
|
||||
nullable: true
|
||||
canceled:
|
||||
type: boolean
|
||||
nullable: true
|
||||
participants:
|
||||
type: array
|
||||
items:
|
||||
@ -391,7 +423,7 @@ components:
|
||||
shipcalls:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/shipcall'
|
||||
$ref: "#/components/schemas/shipcall"
|
||||
|
||||
times:
|
||||
type: object
|
||||
@ -402,20 +434,46 @@ components:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
start_planned:
|
||||
eta_berth:
|
||||
type: string
|
||||
format: date-time
|
||||
end_planned:
|
||||
nullable: true
|
||||
eta_berth_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
etd_berth:
|
||||
type: string
|
||||
format: date-time
|
||||
duration_planned:
|
||||
type: integer
|
||||
start_actual:
|
||||
nullable: true
|
||||
etd_berth_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
lock_time:
|
||||
type: string
|
||||
format: date-time
|
||||
end_actual:
|
||||
nullable: true
|
||||
lock_time_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
zone_entry:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
zone_entry_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
operations_start:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
operations_end:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
remarks:
|
||||
type: string
|
||||
maxLength: 512
|
||||
nullable: true
|
||||
shipcall_id:
|
||||
type: integer
|
||||
participant_id:
|
||||
@ -431,7 +489,7 @@ components:
|
||||
times_list:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/times'
|
||||
$ref: "#/components/schemas/times"
|
||||
|
||||
berth:
|
||||
type: object
|
||||
@ -439,15 +497,30 @@ components:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
name1:
|
||||
name:
|
||||
type: string
|
||||
name2:
|
||||
maxLength: 128
|
||||
participant_id:
|
||||
type: integer
|
||||
nullable: true
|
||||
lock:
|
||||
type: boolean
|
||||
nullable: true
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
modified:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
deleted:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
berth_list:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/berth'
|
||||
$ref: "#/components/schemas/berth"
|
||||
|
||||
ship:
|
||||
type: object
|
||||
@ -457,18 +530,34 @@ components:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
maxLength: 64
|
||||
imo:
|
||||
type: integer
|
||||
nullable: true
|
||||
callsign:
|
||||
type: string
|
||||
maxLength: 8
|
||||
nullable: true
|
||||
participant_id:
|
||||
type: integer
|
||||
nullable: true
|
||||
length:
|
||||
type: number
|
||||
format: float
|
||||
nullable: true
|
||||
width:
|
||||
type: number
|
||||
format: float
|
||||
nullable: true
|
||||
is_tug:
|
||||
type: boolean
|
||||
default: false
|
||||
bollard_pull:
|
||||
type: integer
|
||||
nullable: true
|
||||
eni:
|
||||
type: integer
|
||||
nullable: true
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
@ -476,11 +565,14 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
deleted:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
ship_list:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ship'
|
||||
$ref: "#/components/schemas/ship"
|
||||
|
||||
notification:
|
||||
type: object
|
||||
@ -511,7 +603,7 @@ components:
|
||||
notification_list:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/notification'
|
||||
$ref: "#/components/schemas/notification"
|
||||
|
||||
participant:
|
||||
type: object
|
||||
@ -521,12 +613,16 @@ components:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
maxLength: 128
|
||||
street:
|
||||
type: string
|
||||
maxLength: 128
|
||||
postal code:
|
||||
type: string
|
||||
maxLength: 5
|
||||
city:
|
||||
type: string
|
||||
maxLength: 64
|
||||
type:
|
||||
type: integer
|
||||
created:
|
||||
@ -536,11 +632,14 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
deleted:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
participant_list:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/participant'
|
||||
$ref: "#/components/schemas/participant"
|
||||
|
||||
login_result:
|
||||
type: object
|
||||
@ -564,6 +663,28 @@ components:
|
||||
token:
|
||||
type: string
|
||||
|
||||
user_details:
|
||||
type: object
|
||||
description: fields that a user may change
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
old_password:
|
||||
type: string
|
||||
nullable: true
|
||||
new_password:
|
||||
type: string
|
||||
nullable: true
|
||||
first_name:
|
||||
type: string
|
||||
nullable: true
|
||||
last_name:
|
||||
type: string
|
||||
nullable: true
|
||||
user_phone:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
Error:
|
||||
type: object
|
||||
required:
|
||||
@ -584,25 +705,25 @@ components:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
$ref: "#/components/schemas/Error"
|
||||
401:
|
||||
description: Not authorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
$ref: "#/components/schemas/Error"
|
||||
500:
|
||||
description: Unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
$ref: "#/components/schemas/Error"
|
||||
503:
|
||||
description: Not available
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
$ref: "#/components/schemas/Error"
|
||||
|
||||
security:
|
||||
- ApiKey: []
|
||||
|
||||
@ -1,24 +1,232 @@
|
||||
CREATE DATABASE `bremen_calling` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
|
||||
-- --------------------------------------------------------
|
||||
-- Host: 127.0.0.1
|
||||
-- Server Version: 8.0.34-0ubuntu0.22.04.1 - (Ubuntu)
|
||||
-- Server Betriebssystem: Linux
|
||||
-- HeidiSQL Version: 10.2.0.5599
|
||||
-- --------------------------------------------------------
|
||||
|
||||
USE `bremen_calling`
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
|
||||
CREATE TABLE `participant` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.berth
|
||||
CREATE TABLE IF NOT EXISTS `berth` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(128) DEFAULT NULL COMMENT 'Descriptive name',
|
||||
`participant_id` int unsigned DEFAULT NULL COMMENT 'If berth belongs to a participant, reference it here',
|
||||
`lock` bit(1) DEFAULT NULL COMMENT 'The lock must be used',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`deleted` bit(1) DEFAULT b'0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_BERTH_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_BERTH_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Berth of ship for a ship call';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.notification
|
||||
CREATE TABLE IF NOT EXISTS `notification` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`times_id` int unsigned NOT NULL COMMENT 'times record that caused the notification',
|
||||
`participant_id` int unsigned NOT NULL COMMENT 'participant ref',
|
||||
`acknowledged` bit(1) DEFAULT b'0' COMMENT 'true if UI acknowledged',
|
||||
`level` tinyint DEFAULT NULL COMMENT 'severity of the notification',
|
||||
`type` tinyint DEFAULT NULL COMMENT 'Email/UI/Other',
|
||||
`message` varchar(256) DEFAULT NULL COMMENT 'individual message',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_NOT_TIMES` (`times_id`),
|
||||
KEY `FK_NOT_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_NOT_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`),
|
||||
CONSTRAINT `FK_NOT_TIMES` FOREIGN KEY (`times_id`) REFERENCES `times` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='An entry corresponds to an alarm given by a violated rule during times update';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.participant
|
||||
CREATE TABLE IF NOT EXISTS `participant` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(128) DEFAULT NULL,
|
||||
`street` varchar(128) DEFAULT NULL,
|
||||
`postal_code` varchar(5) DEFAULT NULL,
|
||||
`city` varchar(64) DEFAULT NULL,
|
||||
`type` int(10) DEFAULT NULL,
|
||||
`flags` int(10) unsigned DEFAULT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`type` int DEFAULT NULL,
|
||||
`flags` int unsigned DEFAULT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`deleted` bit(1) DEFAULT b'0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='An organization taking part';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='An organization taking part';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
CREATE TABLE `user` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`participant_id` int(11) UNSIGNED DEFAULT NULL,
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.role
|
||||
CREATE TABLE IF NOT EXISTS `role` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) NOT NULL DEFAULT '0' COMMENT 'unique role name',
|
||||
`description` varchar(255) DEFAULT '0' COMMENT 'role description',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='logical group of securables for one or more user';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.role_securable_map
|
||||
CREATE TABLE IF NOT EXISTS `role_securable_map` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`role_id` int unsigned NOT NULL,
|
||||
`securable_id` int unsigned NOT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_ROLE_SECURABLE` (`role_id`),
|
||||
KEY `FK_SECURABLE_ROLE` (`securable_id`),
|
||||
CONSTRAINT `FK_ROLE_SECURABLE` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`),
|
||||
CONSTRAINT `FK_SECURABLE_ROLE` FOREIGN KEY (`securable_id`) REFERENCES `securable` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Assigns securables to roles';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.securable
|
||||
CREATE TABLE IF NOT EXISTS `securable` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) NOT NULL DEFAULT '',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Actual permission on a single(!) feature or operation';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.ship
|
||||
CREATE TABLE IF NOT EXISTS `ship` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(64) DEFAULT NULL,
|
||||
`imo` int DEFAULT NULL,
|
||||
`callsign` varchar(8) DEFAULT NULL,
|
||||
`participant_id` int unsigned DEFAULT NULL,
|
||||
`length` float DEFAULT NULL,
|
||||
`width` float DEFAULT NULL,
|
||||
`is_tug` bit(1) DEFAULT b'0',
|
||||
`bollard_pull` int DEFAULT NULL,
|
||||
`eni` int DEFAULT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`deleted` bit(1) DEFAULT b'0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_SHIP_PARTICIPANT` (`participant_id`),
|
||||
CONSTRAINT `FK_SHIP_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.shipcall
|
||||
CREATE TABLE IF NOT EXISTS `shipcall` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`ship_id` int unsigned DEFAULT NULL,
|
||||
`type` tinyint DEFAULT NULL,
|
||||
`eta` datetime DEFAULT NULL,
|
||||
`voyage` varchar(16) DEFAULT NULL,
|
||||
`etd` datetime DEFAULT NULL,
|
||||
`arrival_berth_id` int unsigned DEFAULT NULL,
|
||||
`departure_berth_id` int unsigned DEFAULT NULL,
|
||||
`tug_required` bit(1) DEFAULT NULL,
|
||||
`pilot_required` bit(1) DEFAULT NULL,
|
||||
`flags` int unsigned DEFAULT '0',
|
||||
`pier_side` bit(1) DEFAULT NULL,
|
||||
`bunkering` bit(1) DEFAULT NULL,
|
||||
`replenishing_terminal` bit(1) DEFAULT NULL,
|
||||
`replenishing_lock` bit(1) DEFAULT NULL,
|
||||
`draft` float DEFAULT NULL,
|
||||
`tidal_window_from` datetime DEFAULT NULL,
|
||||
`tidal_window_to` datetime DEFAULT NULL,
|
||||
`rain_sensitive_cargo` bit(1) DEFAULT b'0',
|
||||
`recommended_tugs` int DEFAULT '0',
|
||||
`anchored` bit(1) DEFAULT NULL,
|
||||
`moored_lock` bit(1) DEFAULT NULL,
|
||||
`canceled` bit(1) DEFAULT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_SHIPCALL_SHIP` (`ship_id`),
|
||||
KEY `FK_SHIPCALL_BERTH_ARRIVAL` (`arrival_berth_id`),
|
||||
KEY `FK_SHIPCALL_BERTH_DEPARTURE` (`departure_berth_id`),
|
||||
CONSTRAINT `FK_SHIPCALL_BERTH_ARRIVAL` FOREIGN KEY (`arrival_berth_id`) REFERENCES `berth` (`id`),
|
||||
CONSTRAINT `FK_SHIPCALL_BERTH_DEPARTURE` FOREIGN KEY (`departure_berth_id`) REFERENCES `berth` (`id`),
|
||||
CONSTRAINT `FK_SHIPCALL_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Incoming, outgoing or moving to another berth';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.shipcall_participant_map
|
||||
CREATE TABLE IF NOT EXISTS `shipcall_participant_map` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`shipcall_id` int unsigned DEFAULT NULL,
|
||||
`participant_id` int unsigned DEFAULT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_MAP_PARTICIPANT_SHIPCALL` (`shipcall_id`),
|
||||
KEY `FK_MAP_SHIPCALL_PARTICIPANT` (`participant_id`),
|
||||
CONSTRAINT `FK_MAP_PARTICIPANT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`),
|
||||
CONSTRAINT `FK_MAP_SHIPCALL_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Associates a participant with a shipcall';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.shipcall_tug_map
|
||||
CREATE TABLE IF NOT EXISTS `shipcall_tug_map` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`shipcall_id` int unsigned NOT NULL COMMENT 'Ref to ship call',
|
||||
`ship_id` int unsigned NOT NULL COMMENT 'Ref to ship (that is a tug)',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_SCT_SHIP` (`ship_id`),
|
||||
KEY `FK_SCT_SHIPCALL` (`shipcall_id`),
|
||||
CONSTRAINT `FK_SCT_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`),
|
||||
CONSTRAINT `FK_SCT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Mapping table that assigns tugs to a ship call';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.times
|
||||
CREATE TABLE IF NOT EXISTS `times` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`eta_berth` datetime DEFAULT NULL,
|
||||
`eta_berth_fixed` bit(1) DEFAULT NULL,
|
||||
`etd_berth` datetime DEFAULT NULL,
|
||||
`etd_berth_fixed` bit(1) DEFAULT NULL,
|
||||
`lock_time` datetime DEFAULT NULL,
|
||||
`lock_time_fixed` bit(1) DEFAULT NULL,
|
||||
`zone_entry` datetime DEFAULT NULL,
|
||||
`zone_entry_fixed` bit(1) DEFAULT NULL,
|
||||
`operations_start` datetime DEFAULT NULL,
|
||||
`operations_end` datetime DEFAULT NULL,
|
||||
`remarks` varchar(512) DEFAULT NULL,
|
||||
`shipcall_id` int unsigned NOT NULL,
|
||||
`participant_id` int unsigned NOT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `FK_TIME_SHIPCALL` (`shipcall_id`),
|
||||
KEY `FK_TIME_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_TIME_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='the planned time for the participants work';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.user
|
||||
CREATE TABLE IF NOT EXISTS `user` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`participant_id` int unsigned DEFAULT NULL,
|
||||
`first_name` varchar(45) DEFAULT NULL,
|
||||
`last_name` varchar(45) DEFAULT NULL,
|
||||
`user_name` varchar(45) DEFAULT NULL,
|
||||
@ -26,185 +234,31 @@ CREATE TABLE `user` (
|
||||
`user_phone` varchar(128) DEFAULT NULL,
|
||||
`password_hash` varchar(128) DEFAULT NULL,
|
||||
`api_key` varchar(256) DEFAULT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_USER_PART` (`participant_id`),
|
||||
KEY `FK_USER_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_USER_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='member of a participant';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='member of a participant';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
CREATE TABLE `berth` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(128) NULL DEFAULT NULL COMMENT 'Descriptive name',
|
||||
`participant_id` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT 'If berth belongs to a participant, reference it here',
|
||||
`lock` BIT(1) NULL DEFAULT NULL COMMENT 'The lock must be used',
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
-- Exportiere Struktur von Tabelle bremen_calling.user_role_map
|
||||
CREATE TABLE IF NOT EXISTS `user_role_map` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int unsigned NOT NULL DEFAULT '0',
|
||||
`role_id` int unsigned NOT NULL DEFAULT '0',
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_BERTH_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_BERTH_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) COMMENT='Berth of ship for a ship call' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `ship` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(45) DEFAULT NULL,
|
||||
`imo` int(11) DEFAULT NULL,
|
||||
`callsign` varchar(8) DEFAULT NULL,
|
||||
`participant_id` INT(11) UNSIGNED NULL DEFAULT NULL,
|
||||
`length` FLOAT NULL DEFAULT NULL,
|
||||
`width` FLOAT NULL DEFAULT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_SHIP_PARTICIPANT` (`participant_id`),
|
||||
CONSTRAINT `FK_SHIP_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `shipcall` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`ship_id` INT(11) UNSIGNED NULL DEFAULT NULL,
|
||||
`type` TINYINT(4) NULL DEFAULT NULL,
|
||||
`eta` DATETIME NULL DEFAULT NULL,
|
||||
`voyage` VARCHAR(16) NULL DEFAULT NULL,
|
||||
`etd` DATETIME NULL DEFAULT NULL,
|
||||
`arrival_berth_id` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
`departure_berth_id` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
`tug_required` BIT(1) NULL DEFAULT NULL,
|
||||
`pilot_required` BIT(1) NULL DEFAULT NULL,
|
||||
`flags` INT(10) UNSIGNED NULL DEFAULT 0,
|
||||
`pier_side` BIT(1) NULL DEFAULT NULL,
|
||||
`bunkering` BIT(1) NULL DEFAULT NULL,
|
||||
`replenishing` BIT(1) NULL DEFAULT NULL,
|
||||
`draft` FLOAT NULL DEFAULT NULL,
|
||||
`tidal_window_from` DATETIME NULL DEFAULT NULL,
|
||||
`tidal_window_to` DATETIME NULL DEFAULT NULL,
|
||||
`rain_sensitive_cargo` BIT(1) NULL DEFAULT b'0',
|
||||
`recommended_tugs` INT(11) NULL DEFAULT 0,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_SHIPCALL_SHIP` (`ship_id`),
|
||||
INDEX `FK_SHIPCALL_BERTH_ARRIVAL` (`arrival_berth_id`),
|
||||
INDEX `FK_SHIPCALL_BERTH_DEPARTURE` (`departure_berth_id`),
|
||||
CONSTRAINT `FK_SHIPCALL_BERTH_ARRIVAL` FOREIGN KEY (`arrival_berth_id`) REFERENCES `berth` (`id`),
|
||||
CONSTRAINT `FK_SHIPCALL_BERTH_DEPARTURE` FOREIGN KEY (`departure_berth_id`) REFERENCES `berth` (`id`),
|
||||
CONSTRAINT `FK_SHIPCALL_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`)
|
||||
) COMMENT='Incoming, outgoing or moving to another berth' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `times` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`start_planned` datetime DEFAULT NULL,
|
||||
`end_planned` datetime DEFAULT NULL,
|
||||
`duration_planned` int(11) DEFAULT NULL,
|
||||
`start_actual` datetime DEFAULT NULL,
|
||||
`end_actual` datetime DEFAULT NULL,
|
||||
`duration_actual` int(11) DEFAULT NULL,
|
||||
`shipcall_id` int(11) UNSIGNED DEFAULT NULL,
|
||||
`participant_id` int(11) UNSIGNED DEFAULT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_TIME_SHIPCALL` (`shipcall_id`),
|
||||
INDEX `FK_TIME_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_TIME_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`),
|
||||
CONSTRAINT `FK_TIME_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='the planned time for the participants work';
|
||||
|
||||
|
||||
CREATE TABLE `shipcall_participant_map` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`shipcall_id` int(10) unsigned DEFAULT NULL,
|
||||
`participant_id` int(10) unsigned DEFAULT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_MAP_PARTICIPANT_SHIPCALL` (`shipcall_id`),
|
||||
INDEX `FK_MAP_SHIPCALL_PARTICIPANT` (`participant_id`),
|
||||
CONSTRAINT `FK_MAP_PARTICIPANT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`),
|
||||
CONSTRAINT `FK_MAP_SHIPCALL_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Associates a participant with a shipcall';
|
||||
|
||||
|
||||
CREATE TABLE `shipcall_tug_map` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`shipcall_id` INT(11) UNSIGNED NOT NULL COMMENT 'Ref to ship call',
|
||||
`ship_id` INT(11) UNSIGNED NOT NULL COMMENT 'Ref to ship (that is a tug)',
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_SCT_SHIP` (`ship_id`),
|
||||
INDEX `FK_SCT_SHIPCALL` (`shipcall_id`),
|
||||
CONSTRAINT `FK_SCT_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`),
|
||||
CONSTRAINT `FK_SCT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`)
|
||||
) COMMENT='Mapping table that assigns tugs to a ship call' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `notification` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`times_id` INT(11) UNSIGNED NOT NULL COMMENT 'times record that caused the notification',
|
||||
`participant_id` INT(11) UNSIGNED NOT NULL COMMENT 'participant ref',
|
||||
`acknowledged` BIT(1) NULL DEFAULT b'0' COMMENT 'true if UI acknowledged',
|
||||
`level` TINYINT(4) NULL DEFAULT NULL COMMENT 'severity of the notification',
|
||||
`type` TINYINT(4) NULL DEFAULT NULL COMMENT 'Email/UI/Other',
|
||||
`message` VARCHAR(256) NULL DEFAULT NULL COMMENT 'individual message',
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_NOT_TIMES` (`times_id`),
|
||||
INDEX `FK_NOT_PART` (`participant_id`),
|
||||
CONSTRAINT `FK_NOT_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`),
|
||||
CONSTRAINT `FK_NOT_TIMES` FOREIGN KEY (`times_id`) REFERENCES `times` (`id`)
|
||||
) COMMENT='An entry corresponds to an alarm given by a violated rule during times update' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE `role` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT 'unique role name',
|
||||
`description` VARCHAR(255) NULL DEFAULT '0' COMMENT 'role description',
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `name` (`name`)
|
||||
) COMMENT='logical group of securables for one or more user' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE `securable` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(50) NOT NULL DEFAULT '',
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `name` (`name`)
|
||||
) COMMENT='Actual permission on a single(!) feature or operation' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE `user_role_map` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`role_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_USER_ROLE` (`user_id`),
|
||||
INDEX `FK_ROLE_USER` (`role_id`),
|
||||
KEY `FK_USER_ROLE` (`user_id`),
|
||||
KEY `FK_ROLE_USER` (`role_id`),
|
||||
CONSTRAINT `FK_ROLE_USER` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`),
|
||||
CONSTRAINT `FK_USER_ROLE` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
|
||||
) COMMENT='Assigns a user to a role' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Assigns a user to a role';
|
||||
|
||||
-- Daten Export vom Benutzer nicht ausgewählt
|
||||
|
||||
CREATE TABLE `role_securable_map` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`role_id` INT(10) UNSIGNED NOT NULL,
|
||||
`securable_id` INT(10) UNSIGNED NOT NULL,
|
||||
`created` DATETIME NULL DEFAULT current_timestamp(),
|
||||
`modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FK_ROLE_SECURABLE` (`role_id`),
|
||||
INDEX `FK_SECURABLE_ROLE` (`securable_id`),
|
||||
CONSTRAINT `FK_ROLE_SECURABLE` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`),
|
||||
CONSTRAINT `FK_SECURABLE_ROLE` FOREIGN KEY (`securable_id`) REFERENCES `securable` (`id`)
|
||||
) COMMENT='Assigns securables to roles' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB;
|
||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
|
||||
@ -1,140 +1,136 @@
|
||||
-- MySQL dump 10.19 Distrib 10.3.38-MariaDB, for debian-linux-gnueabihf (armv8l)
|
||||
--
|
||||
-- Host: localhost Database: bremen_calling
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 10.3.38-MariaDB-0+deb10u1
|
||||
-- --------------------------------------------------------
|
||||
-- Host: 127.0.0.1
|
||||
-- Server Version: 8.0.34-0ubuntu0.22.04.1 - (Ubuntu)
|
||||
-- Server Betriebssystem: Linux
|
||||
-- HeidiSQL Version: 10.2.0.5599
|
||||
-- --------------------------------------------------------
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `berth`
|
||||
--
|
||||
|
||||
USE `bremen_calling`;
|
||||
|
||||
LOCK TABLES `berth` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.berth: ~3 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `berth` DISABLE KEYS */;
|
||||
INSERT INTO `berth` (`id`, `name`) VALUES (1,'Roland Mühle'),(2,'Stahlwerk'),(3,'Kellogs');
|
||||
INSERT INTO `berth` (`id`, `name`, `participant_id`, `lock`, `created`, `modified`, `deleted`) VALUES
|
||||
(1, 'Roland Mühle', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0'),
|
||||
(2, 'Stahlwerk', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0'),
|
||||
(3, 'Kellogs', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0');
|
||||
/*!40000 ALTER TABLE `berth` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `notification`
|
||||
--
|
||||
|
||||
LOCK TABLES `notification` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.notification: ~0 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `notification` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `notification` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `participant`
|
||||
--
|
||||
|
||||
LOCK TABLES `participant` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.participant: ~11 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `participant` DISABLE KEYS */;
|
||||
INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `type`, `flags`, `created`, `modified`) VALUES (1,'Schick Informatik','Gottlieb-Daimler-Str. 8','73614','Schorndorf',1,42,'2023-04-17 07:18:19',NULL);
|
||||
INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `type`, `flags`, `created`, `modified`, `deleted`) VALUES
|
||||
(1, 'Schick Informatik', 'Gottlieb-Daimler-Str. 8', '73614', 'Schorndorf', 1, 42, '2023-04-17 07:18:19', '2023-08-07 11:35:37', b'0'),
|
||||
(2, 'Lotsenbrüderschaft Weser 1', '', '', '', 4, 0, '2023-08-10 07:07:41', NULL, b'0'),
|
||||
(3, 'Bremer Schiffsmeldedienst', 'Hafenkopf II / Überseetor 20', '28217', 'Bremen', 1, 0, '2023-08-10 07:11:10', NULL, b'0'),
|
||||
(4, 'BLG Cargo Logistics GmbH', '', '', '', 2, 0, '2023-08-10 07:14:40', NULL, b'0'),
|
||||
(5, 'Schiffsmakler-Verband für Küsten und Seeschiffsbefrachter e.V.', '', '', '', 8, 0, '2023-08-10 07:15:56', NULL, b'0'),
|
||||
(6, 'RMS Rhenus Maritime Services GmbH', '', '', '', 8, 0, '2023-08-10 07:19:29', NULL, b'0'),
|
||||
(7, 'J.MÜLLER Weser GmbH & Co. KG', '', '', '', 10, 0, '2023-08-10 07:21:43', '2023-08-10 08:47:59', b'0'),
|
||||
(8, 'Schiffahrtskontor Detra GmbH & Co.KG', '', '', '', 8, 0, '2023-08-10 07:23:04', NULL, b'0'),
|
||||
(9, 'Boluda Deutschland GmbH', '', '', '', 64, 0, '2023-08-10 07:24:18', NULL, b'0'),
|
||||
(10, 'Weserport GmbH', '', '', '', 10, 0, '2023-08-10 07:26:42', '2023-08-10 08:48:19', b'0'),
|
||||
(11, 'Port Authority Bremen', '', '', '', 32, 0, '2023-08-10 07:28:11', NULL, b'0');
|
||||
/*!40000 ALTER TABLE `participant` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `role`
|
||||
--
|
||||
|
||||
LOCK TABLES `role` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.role: ~2 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
|
||||
INSERT INTO `role` (`id`, `name`, `description`, `created`, `modified`) VALUES (1,'My first role','A very good description','2023-04-17 07:31:57',NULL),(2,'Another role','This role is very nice as well','2023-04-17 07:32:12',NULL);
|
||||
INSERT INTO `role` (`id`, `name`, `description`, `created`, `modified`) VALUES
|
||||
(1, 'My first role', 'A very good description', '2023-04-17 07:31:57', NULL),
|
||||
(2, 'Another role', 'This role is very nice as well', '2023-04-17 07:32:12', NULL);
|
||||
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `role_securable_map`
|
||||
--
|
||||
|
||||
LOCK TABLES `role_securable_map` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.role_securable_map: ~0 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `role_securable_map` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `role_securable_map` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `securable`
|
||||
--
|
||||
|
||||
LOCK TABLES `securable` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.securable: ~2 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `securable` DISABLE KEYS */;
|
||||
INSERT INTO `securable` (`id`, `name`, `created`, `modified`) VALUES (1,'First secure thing','2023-04-17 07:38:12',NULL),(2,'Another secure thing','2023-04-17 07:38:22',NULL);
|
||||
INSERT INTO `securable` (`id`, `name`, `created`, `modified`) VALUES
|
||||
(1, 'First secure thing', '2023-04-17 07:38:12', NULL),
|
||||
(2, 'Another secure thing', '2023-04-17 07:38:22', NULL);
|
||||
/*!40000 ALTER TABLE `securable` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ship`
|
||||
--
|
||||
|
||||
LOCK TABLES `ship` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.ship: ~2 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `ship` DISABLE KEYS */;
|
||||
INSERT INTO `ship` (`id`, `name`, `imo`, `callsign`, `participant_id`, `length`, `width`, `is_tug`, `bollard_pull`, `eni`, `created`, `modified`, `deleted`) VALUES
|
||||
(1, 'Dicke Berta', 1234567, 'DEBE', 1, 100, 20, b'0', NULL, NULL, '2023-06-27 10:43:02', NULL, b'0'),
|
||||
(2, 'Maersk Neston', 9632167, '9V3532', 1, 210.07, 30.2, b'0', NULL, NULL, '2023-07-27 12:34:13', NULL, b'0');
|
||||
/*!40000 ALTER TABLE `ship` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `shipcall`
|
||||
--
|
||||
|
||||
LOCK TABLES `shipcall` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.shipcall: ~8 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `shipcall` DISABLE KEYS */;
|
||||
INSERT INTO `shipcall` (`id`, `ship_id`, `type`, `eta`, `voyage`, `etd`, `arrival_berth_id`, `departure_berth_id`, `tug_required`, `pilot_required`, `flags`, `pier_side`, `bunkering`, `replenishing_terminal`, `replenishing_lock`, `draft`, `tidal_window_from`, `tidal_window_to`, `rain_sensitive_cargo`, `recommended_tugs`, `anchored`, `moored_lock`, `canceled`, `created`, `modified`) VALUES
|
||||
(3, 1, 1, '2023-08-13 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 3, NULL, NULL, NULL, '2023-06-27 11:03:28', '2023-08-07 15:19:56'),
|
||||
(4, 2, 1, '2023-08-14 10:43:02', '43', NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0', 0, NULL, NULL, NULL, '2023-07-27 12:36:49', '2023-08-07 15:19:56'),
|
||||
(5, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-11 15:11:50', NULL),
|
||||
(6, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-11 15:11:53', NULL),
|
||||
(7, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:12:34', NULL),
|
||||
(8, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:14:52', NULL),
|
||||
(9, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:17:09', NULL),
|
||||
(10, 1, 1, '2023-08-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 3, NULL, NULL, NULL, '2023-08-14 07:55:48', '2023-08-14 07:56:52');
|
||||
/*!40000 ALTER TABLE `shipcall` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `shipcall_participant_map`
|
||||
--
|
||||
|
||||
LOCK TABLES `shipcall_participant_map` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.shipcall_participant_map: ~6 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `shipcall_participant_map` DISABLE KEYS */;
|
||||
INSERT INTO `shipcall_participant_map` (`id`, `shipcall_id`, `participant_id`, `created`, `modified`) VALUES
|
||||
(1, 3, 2, '2023-08-11 15:01:23', NULL),
|
||||
(2, 3, 4, '2023-08-11 15:01:29', NULL),
|
||||
(3, 9, 2, '2023-08-13 12:17:17', NULL),
|
||||
(4, 9, 4, '2023-08-13 12:17:18', NULL),
|
||||
(24, 10, 3, '2023-08-14 08:48:30', NULL),
|
||||
(26, 10, 9, '2023-08-14 09:03:29', NULL);
|
||||
/*!40000 ALTER TABLE `shipcall_participant_map` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `times`
|
||||
--
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.shipcall_tug_map: ~0 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `shipcall_tug_map` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `shipcall_tug_map` ENABLE KEYS */;
|
||||
|
||||
LOCK TABLES `times` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.times: ~0 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `times` DISABLE KEYS */;
|
||||
INSERT INTO `times` (`id`, `eta_berth`, `eta_berth_fixed`, `etd_berth`, `etd_berth_fixed`, `lock_time`, `lock_time_fixed`, `zone_entry`, `zone_entry_fixed`, `operations_start`, `operations_end`, `remarks`, `shipcall_id`, `participant_id`, `created`, `modified`) VALUES
|
||||
(1, '2023-05-18 07:18:19', NULL, '2023-05-18 09:18:19', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, 1, '2023-06-27 11:05:01', '2023-06-27 11:05:30');
|
||||
/*!40000 ALTER TABLE `times` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user`
|
||||
--
|
||||
|
||||
LOCK TABLES `user` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.user: ~21 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
||||
INSERT INTO `user` (`id`, `participant_id`, `first_name`, `last_name`, `user_name`, `password_hash`, `api_key`, `created`, `modified`) VALUES (1,1,'Daniel','Schick','dani',NULL,'0815','2023-04-17 07:15:41',NULL);
|
||||
INSERT INTO `user` (`id`, `participant_id`, `first_name`, `last_name`, `user_name`, `user_email`, `user_phone`, `password_hash`, `api_key`, `created`, `modified`) VALUES
|
||||
(1, 1, 'Daniel', 'Schick', 'dani', NULL, NULL, '$2b$12$qfjw4b3XvGuu0t6HR8OYGOzF5b8gmC6PyIIBNbIXMXEayJunEEKmi', '0815', '2023-04-17 07:15:41', '2023-08-11 11:11:34'),
|
||||
(2, 1, 'Londo', 'Mollari', 'Londo', 'l.mollari@centauri.gov', '+01 555 324 2313', '$2b$12$VwmwvO2dxlOixWc1HjX3j.753SDJTMR.o7av/bVGTM2tLW2jQT0yy', NULL, '2023-06-27 08:34:55', NULL),
|
||||
(3, 2, 'Maik', 'Baudeck', 'maikb', NULL, NULL, '$2b$12$4SxGRlinOrpEVvqDZcE.wOusMZYsepdc6vj1vDpNhbPtApxU8VGPi', '', '2023-08-10 07:09:35', '2023-08-11 11:11:55'),
|
||||
(4, 3, 'Christin', 'Hollmann', 'christinh', NULL, NULL, '$2b$12$ul0QJmcuUhktDYDjcyEpx.6yY1ieLdaCxZ6a3SFSuTq94IqK4Y/re', '', '2023-08-10 07:12:05', '2023-08-11 11:10:33'),
|
||||
(5, 3, 'Bastian', 'Güttner', 'bastiang', NULL, NULL, '$2b$12$0oCX3c2WyMykmxMoLqmpNubke713xhYlEEQgnxBV6Fj/TaUn.3/U6', '', '2023-08-10 07:12:26', '2023-08-11 11:11:13'),
|
||||
(6, 3, 'Benjamin', 'Wiese', 'benjaminw', NULL, NULL, '$2b$12$RRj32KdLIf3D7z7cVWFqa.yZM5.ODOS0HqU3rdCuFrJS8HJ/rtqwy', '', '2023-08-10 07:13:01', '2023-08-11 11:11:16'),
|
||||
(7, 1, 'Sladjan', 'Veselinovic', 'sladjanv', NULL, NULL, '$2b$12$4DctoCbZwxTvE39lXNRzneQ2kb/lXlJ5wEZ1CGbbw.rGM3nuAYjpa', '', '2023-08-10 07:13:39', '2023-08-11 11:11:45'),
|
||||
(8, 1, 'Kersten', 'Gevers', 'kersteng', NULL, NULL, '$2b$12$zKX8iLPnXRmp5wD1Yp8P7e..U9R0A4ytbiMjd.l.IGkMzahcHPNWq', '', '2023-08-10 07:13:59', '2023-08-11 11:11:49'),
|
||||
(9, 4, 'Dirk', 'Brunnert', 'dirkb', NULL, NULL, '$2b$12$HTeq/Fdfse6oElk7DLsQae5dtvWJloee.VtBH.THsj2kdcxxBkCDW', '', '2023-08-10 07:15:01', '2023-08-11 11:12:01'),
|
||||
(10, 5, 'Thorsten', 'Fischer', 'thorstenf', NULL, NULL, '$2b$12$NHEpTNHuKU4ruPRIfd9yc.yv5faHGemFfRI3TISniqM7QNqHiyZpK', '', '2023-08-10 07:16:20', '2023-08-11 11:12:07'),
|
||||
(11, 6, 'Lisa', 'Friedhoff', 'lisaf', NULL, NULL, '$2b$12$DJKJHGrQwfY9pwzgFfPds.DHGsygHyV3KDs38Hq4AUHPPs3jBPH3y', '', '2023-08-10 07:19:52', '2023-08-11 11:12:12'),
|
||||
(12, 6, 'Dario', 'Fritschi', 'dariof', NULL, NULL, '$2b$12$MwCVTMQkN6zCAzCsE572Ye.M0nRDQNld4AgorLVyWq.DcQEmAy5lu', '', '2023-08-10 07:20:11', '2023-08-11 11:12:15'),
|
||||
(13, 7, 'Hergen', 'Hanke', 'hergenh', NULL, NULL, '$2b$12$MKb6BDRrTbNd0qg5BdAS.upzlqxcWOgU/VEafJKSuzE9JLIWCimq6', '', '2023-08-10 07:22:09', '2023-08-11 11:12:24'),
|
||||
(14, 8, 'Hardy', 'Paasch', 'hardyp', NULL, NULL, '$2b$12$l1lE/UqnYnOvci.N4j3zBOz6HC0z87ovnO0n6BIZYO7VN8gj.qGey', '', '2023-08-10 07:23:25', '2023-08-11 11:12:28'),
|
||||
(15, 8, 'Marc', 'Pagel', 'marcp', NULL, NULL, '$2b$12$UCVJKzqX92Z8xZJ4kK0BRuFXMRdqcaXaGmBrqnYWARdKlPvZvLUZq', '', '2023-08-10 07:23:41', '2023-08-11 11:12:30'),
|
||||
(16, 9, 'Andreas', 'Peukert', 'andreasp', NULL, NULL, '$2b$12$jNmciJAVR6p0IflvAthmk.j0SoOBvFHwDiEDKUHfwJq7baRsKg/LG', '', '2023-08-10 07:24:37', '2023-08-11 11:12:45'),
|
||||
(17, 8, 'Christina', 'Rachiele', 'christinar', NULL, NULL, '$2b$12$BCsVgPRuIWPuuor07lprF.klQxvF901O3AXUhRrBJoEvYIjNQ.HKS', '', '2023-08-10 07:25:05', '2023-08-11 11:12:33'),
|
||||
(18, 9, 'Sonia', 'Rekawek', 'soniar', NULL, NULL, '$2b$12$uHCkH6gu13yqllXBibLFIOWOpvctMC7NmojtXqDd6xsLq7bmvNOMu', '', '2023-08-10 07:25:27', '2023-08-11 11:12:48'),
|
||||
(19, 6, 'Frank', 'Roelfs', 'frankr', NULL, NULL, '$2b$12$cEQAhUe9VJV6uTkfOY6/R.oAVfmFZQ4vS5G6BqoNEyaVHtFRDtB56', '', '2023-08-10 07:26:04', '2023-08-11 11:12:19'),
|
||||
(20, 10, 'Vera', 'Schliedermann', 'veras', NULL, NULL, '$2b$12$FKcitW6W1HPwd.cdkZLGLeTFuzjsEIrbiKInysAKN.RibZ4gVLZHi', '', '2023-08-10 07:27:01', '2023-08-11 11:12:54'),
|
||||
(21, 8, 'Michael', 'Strudthoff', 'michaels', NULL, NULL, '$2b$12$doTiywWpkso1UWB5eiAW1eoACP6rN4UDVt7qFFdRFvhhWUXikCmS2', '', '2023-08-10 07:27:27', '2023-08-11 11:12:37'),
|
||||
(22, 4, 'Volker', 'Viohl', 'volkerv', NULL, NULL, '$2b$12$.YavQbWNE4eJDQA.ZNSKROYvMPWifBXyMX0IL0H2z50M720fpfTJW', '', '2023-08-10 07:27:50', '2023-08-11 11:12:04'),
|
||||
(23, 11, 'Frauke', 'Zabel', 'fraukez', NULL, NULL, '$2b$12$rawQg6Cjl1yECGm9DOG8degdWdD.nZjEgGp8eXO98nh11QV1sEEEO', '', '2023-08-10 07:28:33', '2023-08-11 11:12:58'),
|
||||
(24, 8, 'Jan', 'Zierow', 'janz', NULL, NULL, '$2b$12$CbnjUT42cf0mkIAqAURg3OksP9G3brmsE2GQTECTZ4.cVuhPn5D2G', '', '2023-08-10 07:28:55', '2023-08-11 11:12:39');
|
||||
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Dumping data for table `user_role_map`
|
||||
--
|
||||
|
||||
LOCK TABLES `user_role_map` WRITE;
|
||||
-- Exportiere Daten aus Tabelle bremen_calling.user_role_map: ~0 rows (ungefähr)
|
||||
/*!40000 ALTER TABLE `user_role_map` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `user_role_map` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-04-27 9:09:13
|
||||
|
||||
135
src/BreCalClient/.editorconfig
Normal file
135
src/BreCalClient/.editorconfig
Normal file
@ -0,0 +1,135 @@
|
||||
[*.cs]
|
||||
|
||||
# CS8073: The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
dotnet_diagnostic.CS8073.severity = silent
|
||||
csharp_using_directive_placement = outside_namespace:silent
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
csharp_prefer_braces = true:silent
|
||||
csharp_style_namespace_declarations = block_scoped:silent
|
||||
csharp_style_prefer_method_group_conversion = true:silent
|
||||
csharp_style_prefer_top_level_statements = true:silent
|
||||
csharp_style_expression_bodied_methods = false:silent
|
||||
csharp_style_expression_bodied_constructors = false:silent
|
||||
csharp_style_expression_bodied_operators = false:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
csharp_style_expression_bodied_lambdas = true:silent
|
||||
csharp_style_expression_bodied_local_functions = false:silent
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_prefer_null_check_over_type_check = true:suggestion
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_prefer_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_prefer_index_operator = true:suggestion
|
||||
csharp_style_prefer_range_operator = true:suggestion
|
||||
csharp_indent_labels = one_less_than_current
|
||||
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_style_prefer_tuple_swap = true:suggestion
|
||||
csharp_style_prefer_utf8_string_literals = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||
csharp_prefer_static_local_function = true:suggestion
|
||||
csharp_style_prefer_readonly_struct = true:suggestion
|
||||
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
|
||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
|
||||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
|
||||
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
|
||||
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
csharp_style_prefer_switch_expression = true:suggestion
|
||||
csharp_style_prefer_pattern_matching = true:silent
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_prefer_not_pattern = true:suggestion
|
||||
csharp_style_prefer_extended_property_pattern = true:suggestion
|
||||
csharp_style_var_for_built_in_types = false:silent
|
||||
csharp_style_var_when_type_is_apparent = false:silent
|
||||
csharp_style_var_elsewhere = false:silent
|
||||
|
||||
# IDE1006: Naming Styles
|
||||
dotnet_diagnostic.IDE1006.severity = none
|
||||
|
||||
[*.{cs,vb}]
|
||||
#### Naming styles ####
|
||||
|
||||
# Naming rules
|
||||
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||
|
||||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||
|
||||
# Symbol specifications
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.types.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||
|
||||
# Naming styles
|
||||
|
||||
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||
dotnet_naming_style.begins_with_i.required_suffix =
|
||||
dotnet_naming_style.begins_with_i.word_separator =
|
||||
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:silent
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
||||
dotnet_style_namespace_match_folder = true:suggestion
|
||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
end_of_line = crlf
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||
dotnet_style_predefined_type_for_member_access = true:silent
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
|
||||
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
|
||||
dotnet_code_quality_unused_parameters = all:suggestion
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
dotnet_style_qualification_for_field = false:silent
|
||||
dotnet_style_qualification_for_property = false:silent
|
||||
dotnet_style_qualification_for_method = false:silent
|
||||
dotnet_style_qualification_for_event = false:silent
|
||||
52
src/BreCalClient/AboutDialog.xaml
Normal file
52
src/BreCalClient/AboutDialog.xaml
Normal file
@ -0,0 +1,52 @@
|
||||
<Window x:Class="BreCalClient.AboutDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
||||
mc:Ignorable="d"
|
||||
Title="Help" Height="270" Width="500">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="10" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Projektleitung" HorizontalContentAlignment="Right"/>
|
||||
<Label Grid.Column="0" Grid.Row="1" Content="Softwareentwicklung" HorizontalContentAlignment="Right"/>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" VerticalAlignment="Center">
|
||||
<Hyperlink NavigateUri="https://www.bsmd.de" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
Bremer Schiffsmeldedienst
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" VerticalAlignment="Center">
|
||||
<Hyperlink NavigateUri="http://www.textbausteine.net/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
Informatikbüro Daniel Schick
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<Label FontWeight="DemiBold" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textChangePassword}" HorizontalContentAlignment="Right"/>
|
||||
|
||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textOldPassword}" Grid.Column="1" Grid.Row="3" Margin="2" x:Name="wpBoxOldPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textNewPassword}" Grid.Column="1" Grid.Row="4" Margin="2" x:Name="wpBoxNewPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textRepeatNewPassword}" Grid.Column="1" Grid.Row="5" Margin="2" x:Name="wpBoxNewPasswordRepeat" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||
<Button x:Name="buttonChangePassword" Click="buttonChangePassword_Click" Grid.Column="1" Grid.Row="6" Margin="2" Content="{x:Static p:Resources.textChange}" Width="80" HorizontalAlignment="Left" IsEnabled="False" />
|
||||
|
||||
<Button x:Name="buttonClose" Click="buttonClose_Click" Content="{x:Static p:Resources.textClose}" Width="80" Margin="2" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Right" />
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
64
src/BreCalClient/AboutDialog.xaml.cs
Normal file
64
src/BreCalClient/AboutDialog.xaml.cs
Normal file
@ -0,0 +1,64 @@
|
||||
// Copyright (c) 2023 schick Informatik
|
||||
// Description: Show about info and allow user detail editing
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BreCalClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for AboutDialog.xaml
|
||||
/// </summary>
|
||||
public partial class AboutDialog : Window
|
||||
{
|
||||
|
||||
#region Construction
|
||||
|
||||
public AboutDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
|
||||
public event Action<string, string>? ChangePasswordRequested;
|
||||
|
||||
#endregion
|
||||
|
||||
#region event handler
|
||||
|
||||
private void buttonClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void buttonChangePassword_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.ChangePasswordRequested?.Invoke(this.wpBoxOldPassword.Password, this.wpBoxNewPassword.Password);
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void wpBoxOldPassword_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
this.buttonChangePassword.IsEnabled =
|
||||
(this.wpBoxOldPassword.Password.Length > 0) &&
|
||||
(this.wpBoxNewPassword.Password.Length > 0) &&
|
||||
(this.wpBoxNewPasswordRepeat.Password.Length > 0) &&
|
||||
this.wpBoxNewPassword.Password.Equals(this.wpBoxNewPasswordRepeat.Password) &&
|
||||
(!this.wpBoxNewPassword.Password.Equals(this.wpBoxOldPassword.Password));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@ -8,10 +8,11 @@
|
||||
<SignAssembly>True</SignAssembly>
|
||||
<StartupObject>BreCalClient.App</StartupObject>
|
||||
<AssemblyOriginatorKeyFile>E:\gitlager\git_brcal\misc\brecal.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
||||
<FileVersion>0.1.0.0</FileVersion>
|
||||
<AssemblyVersion>0.3.0.0</AssemblyVersion>
|
||||
<FileVersion>0.3.0.0</FileVersion>
|
||||
<Title>Bremen calling client</Title>
|
||||
<Description>A Windows WPF client for the Bremen calling API.</Description>
|
||||
<ApplicationIcon>containership.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -22,6 +23,7 @@
|
||||
<None Remove="Resources\arrow_up_red.png" />
|
||||
<None Remove="Resources\clipboard.png" />
|
||||
<None Remove="Resources\clock.png" />
|
||||
<None Remove="Resources\containership.ico" />
|
||||
<None Remove="Resources\containership.png" />
|
||||
<None Remove="Resources\emergency_stop_button.png" />
|
||||
<None Remove="Resources\logo_bremen_calling.png" />
|
||||
@ -50,6 +52,10 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="containership.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\misc\BreCalApi.yaml" Link="BreCalApi.yaml">
|
||||
<Generator>OpenApiCodeGenerator</Generator>
|
||||
@ -62,6 +68,7 @@
|
||||
<Resource Include="Resources\arrow_up_red.png" />
|
||||
<Resource Include="Resources\clipboard.png" />
|
||||
<Resource Include="Resources\clock.png" />
|
||||
<Resource Include="Resources\containership.ico" />
|
||||
<Resource Include="Resources\containership.png" />
|
||||
<Resource Include="Resources\emergency_stop_button.png" />
|
||||
<Resource Include="Resources\logo_bremen_calling.png" />
|
||||
|
||||
@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33627.172
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BreCalClient", "BreCalClient.csproj", "{FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BreCalClient", "BreCalClient.csproj", "{FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EE0DC107-4A84-442F-89B2-2FF2557F761A}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@ -4,9 +4,111 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
||||
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d"
|
||||
Title="EditShipcallControl" Height="450" Width="800">
|
||||
Title="{x:Static p:Resources.textEditShipcall}" Height="466" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.15*"/>
|
||||
<ColumnDefinition Width=".35*" />
|
||||
<ColumnDefinition Width="0.15*"/>
|
||||
<ColumnDefinition Width=".35*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Content="{x:Static p:Resources.textShip}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textType}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" />
|
||||
<Label Content="ETA" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textVoyage}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="ETD" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textArrivalTerminal}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textDepartureTerminal}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textTugRequired}" Grid.Column="1" Grid.Row="7" />
|
||||
<Label Content="{x:Static p:Resources.textPilotRequired}" Grid.Column="1" Grid.Row="8" />
|
||||
<Label Content="{x:Static p:Resources.textPierside}" Grid.Column="0" Grid.Row="9" HorizontalContentAlignment="Right" />
|
||||
<Label Content="{x:Static p:Resources.textBunkering}" Grid.Column="1" Grid.Row="10" />
|
||||
<Label Content="{x:Static p:Resources.textReplenishingTerminal}" Grid.Column="1" Grid.Row="11" />
|
||||
<Label Content="{x:Static p:Resources.textReplenishingLock}" Grid.Column="1" Grid.Row="12" />
|
||||
<Label Content="{x:Static p:Resources.textDraft}" Grid.Column="0" Grid.Row="13" HorizontalContentAlignment="Right" />
|
||||
|
||||
<ComboBox x:Name="comboBoxShip" Margin="2" Grid.Column="1" Grid.Row="0" SelectionChanged="comboBoxShip_SelectionChanged">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--Border-->
|
||||
<TextBlock>
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} ({1})">
|
||||
<Binding Path="Name" />
|
||||
<Binding Path="Imo" />
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<!--/Border-->
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<ComboBox x:Name="comboBoxCategories" Grid.Column="1" Margin="2" Grid.Row="1" />
|
||||
<xctk:DateTimePicker x:Name="datePickerETA" Grid.Column="1" Grid.Row="2" Margin="2" />
|
||||
<TextBox x:Name="textBoxVoyage" Grid.Column="1" Grid.Row="3" Margin="2" VerticalContentAlignment="Center" />
|
||||
<xctk:DateTimePicker x:Name="datePickerETD" Grid.Column="1" Grid.Row="4" Margin="2" />
|
||||
<ComboBox Name="comboBoxArrivalBerth" Grid.Column="1" Grid.Row="5" Margin="2" DisplayMemberPath="Name" />
|
||||
<ComboBox Name="comboBoxDepartureBerth" Grid.Column="1" Grid.Row="6" Margin="2" DisplayMemberPath="Name" />
|
||||
<CheckBox x:Name="checkBoxTugRequired" Grid.Column="0" Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<CheckBox x:Name="checkBoxPilotRequired" Grid.Column="0" Grid.Row="8" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<ComboBox x:Name="comboBoxPierside" Grid.Column="1" Grid.Row="9" Margin="2" />
|
||||
<CheckBox x:Name="checkBoxBunkering" Grid.Column="0" Grid.Row="10" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<CheckBox x:Name="checkBoxReplenishingTerminal" Grid.Column="0" Grid.Row="11" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<CheckBox x:Name="checkBoxReplenishingLock" Grid.Column="0" Grid.Row="12" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<xctk:DoubleUpDown x:Name="doubleUpDownDraft" Grid.Column="1" Grid.Row="13" Margin="2" FormatString="C2" Minimum="0" />
|
||||
|
||||
<Label Content="{x:Static p:Resources.textParticipants}" FontWeight="DemiBold" Grid.Column="3" Grid.Row="0" />
|
||||
<Label Content="{x:Static p:Resources.textAgency}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textMooring}" Grid.Column="2" Grid.Row="2" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textPilot}" Grid.Column="2" Grid.Row="3" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textTug}" Grid.Column="2" Grid.Row="4" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textTerminal}" Grid.Column="2" Grid.Row="5" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textTidalWindow}" FontWeight="DemiBold" Grid.Column="3" Grid.Row="6" />
|
||||
<Label Content="{x:Static p:Resources.textFrom}" Grid.Column="2" Grid.Row="7" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textTo}" Grid.Column="2" Grid.Row="8" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textRainSensitiveCargo}" Grid.Column="3" Grid.Row="9" />
|
||||
<Label Content="{x:Static p:Resources.textRecommendedTugs}" Grid.Column="2" Grid.Row="10" HorizontalContentAlignment="Right"/>
|
||||
<Label Content="{x:Static p:Resources.textAnchored}" Grid.Column="3" Grid.Row="11" />
|
||||
<Label Content="{x:Static p:Resources.textMooredLock}" Grid.Column="3" Grid.Row="12" />
|
||||
<Label Content="{x:Static p:Resources.textCancelled}" Grid.Column="3" Grid.Row="13" />
|
||||
<ComboBox Name="comboBoxAgency" Grid.Column="3" Grid.Row="1" Margin="2" DisplayMemberPath="Name"/>
|
||||
<ComboBox Name="comboBoxMooring" Grid.Column="3" Grid.Row="2" Margin="2" DisplayMemberPath="Name"/>
|
||||
<ComboBox Name="comboBoxPilot" Grid.Column="3" Grid.Row="3" Margin="2" DisplayMemberPath="Name"/>
|
||||
<ComboBox Name="comboBoxTug" Grid.Column="3" Grid.Row="4" Margin="2" DisplayMemberPath="Name"/>
|
||||
<ComboBox Name="comboBoxTerminal" Grid.Column="3" Grid.Row="5" Margin="2" DisplayMemberPath="Name"/>
|
||||
<xctk:DateTimePicker Name="datePickerTidalWindowFrom" Grid.Column="3" Grid.Row="7" Margin="2" />
|
||||
<xctk:DateTimePicker Name="datePickerTidalWindowTo" Grid.Column="3" Grid.Row="8" Margin="2" />
|
||||
<CheckBox x:Name="checkBoxRainsensitiveCargo" Grid.Column="2" Grid.Row="9" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<xctk:IntegerUpDown x:Name="integerUpDownRecommendedTugs" Grid.Column="3" Grid.Row="10" Minimum="0" Margin="2" />
|
||||
<CheckBox x:Name="checkBoxAnchored" Grid.Column="2" Grid.Row="11" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<CheckBox x:Name="checkBoxMooredLock" Grid.Column="2" Grid.Row="12" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
<CheckBox x:Name="checkBoxCanceled" Grid.Column="2" Grid.Row="13" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,4,0" />
|
||||
|
||||
<StackPanel Grid.Row="14" Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Width= "80" Margin="2" Content="{x:Static p:Resources.textOK}" x:Name="buttonOK" Click="buttonOK_Click" IsEnabled="False" />
|
||||
<Button Width="80" Margin="2" Content="{x:Static p:Resources.textCancel}" x:Name="buttonCancel" Click="buttonCancel_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
using System;
|
||||
// Copyright (c) 2023 schick Informatik
|
||||
// Description: Windows dialog to create / edit ship calls
|
||||
//
|
||||
|
||||
using BreCalClient.misc.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -23,5 +29,104 @@ namespace BreCalClient
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
public Shipcall Shipcall { get; set; } = new ();
|
||||
|
||||
public List<Participant> Participants { get; set; } = new();
|
||||
|
||||
public List<Berth> Berths { get; set; } = new();
|
||||
|
||||
public List<Ship> Ships { get; set; } = new();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event handler
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<Participant> aList = new();
|
||||
List<Participant> mList = new();
|
||||
List<Participant> pList = new();
|
||||
List<Participant> tList = new();
|
||||
List<Participant> terList = new();
|
||||
|
||||
foreach(Participant p in Participants)
|
||||
{
|
||||
if (p.IsFlagSet(Extensions.ParticipantType.AGENCY)) aList.Add(p);
|
||||
if (p.IsFlagSet(Extensions.ParticipantType.MOORING)) mList.Add(p);
|
||||
if (p.IsFlagSet(Extensions.ParticipantType.PILOT)) pList.Add(p);
|
||||
if (p.IsFlagSet(Extensions.ParticipantType.TUG)) tList.Add(p);
|
||||
if (p.IsFlagSet(Extensions.ParticipantType.TERMINAL)) terList.Add(p);
|
||||
}
|
||||
|
||||
this.comboBoxAgency.ItemsSource = aList;
|
||||
this.comboBoxMooring.ItemsSource = mList;
|
||||
this.comboBoxPilot.ItemsSource = pList;
|
||||
this.comboBoxTug.ItemsSource = tList;
|
||||
this.comboBoxTerminal.ItemsSource = terList;
|
||||
|
||||
this.comboBoxShip.ItemsSource = Ships;
|
||||
this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(Shipcall.TypeEnum));
|
||||
this.comboBoxArrivalBerth.ItemsSource = this.Berths;
|
||||
this.comboBoxDepartureBerth.ItemsSource = this.Berths;
|
||||
|
||||
this.CopyToControls();
|
||||
}
|
||||
|
||||
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.CopyToModel();
|
||||
this.DialogResult = true; this.Close();
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult= false; this.Close();
|
||||
}
|
||||
|
||||
private void comboBoxShip_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
this.buttonOK.IsEnabled = this.comboBoxShip.SelectedItem != null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private methods
|
||||
|
||||
private void CopyToModel()
|
||||
{
|
||||
this.Shipcall.Type = (Shipcall.TypeEnum)this.comboBoxCategories.SelectedValue;
|
||||
this.Shipcall.Eta = this.datePickerETA.Value ?? DateTime.Now;
|
||||
this.Shipcall.Voyage = this.textBoxVoyage.Text.Trim();
|
||||
this.Shipcall.Etd = this.datePickerETD.Value ?? DateTime.Now.AddDays(1);
|
||||
this.Shipcall.Anchored = this.checkBoxAnchored.IsChecked;
|
||||
this.Shipcall.ShipId = ((Ship)this.comboBoxShip.SelectedItem).Id;
|
||||
this.Shipcall.ArrivalBerthId = (this.comboBoxArrivalBerth.SelectedValue != null) ? ((Berth)this.comboBoxArrivalBerth.SelectedValue).Id : null;
|
||||
this.Shipcall.DepartureBerthId = (this.comboBoxDepartureBerth.SelectedValue != null) ? ((Berth)this.comboBoxDepartureBerth.SelectedValue).Id : null;
|
||||
this.Shipcall.Bunkering = this.checkBoxBunkering.IsChecked;
|
||||
this.Shipcall.Canceled = this.checkBoxCanceled.IsChecked;
|
||||
this.Shipcall.Draft = (float?) this.doubleUpDownDraft.Value;
|
||||
this.Shipcall.MooredLock = this.checkBoxMooredLock.IsChecked;
|
||||
// this.Shipcall.PierSide = this.comboBoxPierside.SelectedValue;
|
||||
this.Shipcall.RainSensitiveCargo = this.checkBoxRainsensitiveCargo.IsChecked;
|
||||
this.Shipcall.PilotRequired = this.checkBoxPilotRequired.IsChecked;
|
||||
this.Shipcall.ReplenishingLock = this.checkBoxReplenishingLock.IsChecked;
|
||||
this.Shipcall.ReplenishingTerminal = this.checkBoxReplenishingTerminal.IsChecked;
|
||||
this.Shipcall.RecommendedTugs = this.integerUpDownRecommendedTugs.Value;
|
||||
this.Shipcall.TidalWindowFrom = this.datePickerTidalWindowFrom.Value;
|
||||
this.Shipcall.TidalWindowTo = this.datePickerTidalWindowTo.Value;
|
||||
this.Shipcall.TugReguired = this.checkBoxTugRequired.IsChecked;
|
||||
}
|
||||
|
||||
private void CopyToControls()
|
||||
{
|
||||
if (this.Shipcall == null) return;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
||||
mc:Ignorable="d"
|
||||
Title="{DynamicResource textApplicationTitle}" Height="450" Width="800" Loaded="Window_Loaded" Closing="Window_Closing">
|
||||
Title="{DynamicResource textApplicationTitle}" Height="450" Width="800" Loaded="Window_Loaded" Closing="Window_Closing" Icon="Resources/containership.ico">
|
||||
|
||||
<xctk:BusyIndicator Name="busyIndicator" IsBusy="True">
|
||||
<xctk:BusyIndicator.ProgressBarStyle>
|
||||
@ -57,8 +57,8 @@
|
||||
<ColumnDefinition Width=".2*" />
|
||||
<ColumnDefinition Width=".6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Margin="2" Grid.Column="0" Content="{x:Static p:Resources.textNewDots}" x:Name="buttonNew" Visibility="Hidden" />
|
||||
<Label Content="{x:Static p:Resources.textSortOrder}" Grid.Column="1" />
|
||||
<Button Margin="2" Grid.Column="0" Content="{x:Static p:Resources.textNewDots}" x:Name="buttonNew" Visibility="Hidden" Click="buttonNew_Click" Background="Transparent"/>
|
||||
<Label Content="{x:Static p:Resources.textSortOrder}" Grid.Column="1" HorizontalContentAlignment="Right"/>
|
||||
<ComboBox x:Name="comboBoxSortOrder" Margin="2" Grid.Column="2" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
@ -87,9 +87,13 @@
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="30" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@ -101,18 +105,24 @@
|
||||
<StatusBarItem Grid.Column="0">
|
||||
<TextBlock Name="labelGeneralStatus" FontSize="9"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="1">
|
||||
<TextBlock Name="labelVersion"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="1"/>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock Name="labelUsername"></TextBlock>
|
||||
<TextBlock Name="labelVersion"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="3"/>
|
||||
<StatusBarItem Grid.Column="4">
|
||||
<TextBlock Name="labelStatusBar"></TextBlock>
|
||||
<TextBlock Name="labelUsername"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="5"/>
|
||||
<StatusBarItem Grid.Column="6">
|
||||
<Button x:Name="buttonInfo" Content="?" Click="buttonInfo_Click" Width="20" />
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="7"/>
|
||||
<StatusBarItem Grid.Column="8">
|
||||
<TextBlock Name="labelStatusBar"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="9"/>
|
||||
<StatusBarItem Grid.Column="10">
|
||||
<ProgressBar Name="generalProgressStatus" Width="90" Height="16"/>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
|
||||
@ -21,6 +21,9 @@ namespace BreCalClient
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
|
||||
#region Fields
|
||||
|
||||
private const int SHIPCALL_UPDATE_INTERVAL_SECONDS = 30;
|
||||
private readonly DefaultApi _api;
|
||||
private readonly ObservableCollection<ShipcallControlModel> _controlModels = new();
|
||||
@ -34,6 +37,21 @@ namespace BreCalClient
|
||||
private readonly CancellationTokenSource _tokenSource = new();
|
||||
private LoginResult? _loginResult;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Enums
|
||||
|
||||
private enum ConnectionStatus
|
||||
{
|
||||
UNDEFINED,
|
||||
SUCCESSFUL,
|
||||
FAILED
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Construction
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -41,11 +59,14 @@ namespace BreCalClient
|
||||
_api.Configuration.ApiKeyPrefix["Authorization"] = "Bearer";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region event handler
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.UNDEFINED}";
|
||||
labelVersion.Text = "V. " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
@ -74,16 +95,20 @@ namespace BreCalClient
|
||||
this.busyIndicator.IsBusy = false;
|
||||
this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token;
|
||||
this.LoadStaticLists();
|
||||
this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}";
|
||||
}
|
||||
}
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}";
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
this.labelLoginResult.Content = ex.Message;
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}";
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}";
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,6 +117,56 @@ namespace BreCalClient
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void buttonNew_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
EditShipcallControl esc = new()
|
||||
{
|
||||
Participants = this._participants,
|
||||
Ships = this._ships,
|
||||
Berths = this._berths
|
||||
};
|
||||
|
||||
if (esc.ShowDialog() ?? false)
|
||||
{
|
||||
// save new dialog model
|
||||
|
||||
// add dialog model to list
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonInfo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AboutDialog ad = new();
|
||||
ad.ChangePasswordRequested += async (oldPw, newPw) =>
|
||||
{
|
||||
if (_loginResult != null)
|
||||
{
|
||||
UserDetails ud = new()
|
||||
{
|
||||
Id = _loginResult.Id,
|
||||
FirstName = _loginResult.FirstName,
|
||||
LastName = _loginResult.LastName,
|
||||
UserPhone = _loginResult.UserPhone,
|
||||
OldPassword = oldPw,
|
||||
NewPassword = newPw
|
||||
};
|
||||
try
|
||||
{
|
||||
await _api.UserPutAsync(ud);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
ad.ShowDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private methods
|
||||
@ -107,6 +182,7 @@ namespace BreCalClient
|
||||
_shipLookupDict[ship.Id] = ship;
|
||||
this._participants = await _api.ParticipantsGetAsync();
|
||||
|
||||
List<Participant> agencies = new();
|
||||
foreach (Participant participant in this._participants)
|
||||
{
|
||||
this._participantLookupDict[participant.Id] = participant;
|
||||
@ -115,7 +191,11 @@ namespace BreCalClient
|
||||
App.Participant = participant;
|
||||
EnableControlsForParticipant();
|
||||
}
|
||||
if(participant.IsFlagSet(Extensions.ParticipantType.AGENCY))
|
||||
agencies.Add(participant);
|
||||
}
|
||||
this.searchFilterControl.SetAgencies(agencies);
|
||||
|
||||
_ = Task.Run(() => RefreshShipcalls());
|
||||
}
|
||||
|
||||
@ -129,7 +209,24 @@ namespace BreCalClient
|
||||
{
|
||||
while (!_tokenSource.Token.IsCancellationRequested)
|
||||
{
|
||||
List<Shipcall> shipcalls = await _api.ShipcallsGetAsync();
|
||||
List<Shipcall>? shipcalls = null;
|
||||
try
|
||||
{
|
||||
shipcalls = await _api.ShipcallsGetAsync();
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}";
|
||||
labelGeneralStatus.Text = $"Ok";
|
||||
}));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}";
|
||||
labelStatusBar.Text = ex.Message;
|
||||
}));
|
||||
}
|
||||
if (shipcalls != null)
|
||||
{
|
||||
foreach (Shipcall shipcall in shipcalls)
|
||||
@ -152,19 +249,23 @@ namespace BreCalClient
|
||||
else
|
||||
{
|
||||
// no: create new entry
|
||||
selectedSCMModel = new ShipcallControlModel();
|
||||
selectedSCMModel.Shipcall = shipcall;
|
||||
selectedSCMModel = new()
|
||||
{
|
||||
Shipcall = shipcall
|
||||
};
|
||||
if (this._shipLookupDict.ContainsKey(shipcall.ShipId))
|
||||
selectedSCMModel.Ship = this._shipLookupDict[shipcall.ShipId];
|
||||
if (this._berthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0))
|
||||
selectedSCMModel.Berth = this._berthLookupDict[shipcall.ArrivalBerthId ?? 0].Name1;
|
||||
selectedSCMModel.Berth = this._berthLookupDict[shipcall.ArrivalBerthId ?? 0].Name;
|
||||
|
||||
_controlModels.Add(selectedSCMModel);
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
ShipcallControl sc = new ShipcallControl();
|
||||
sc.Height = 120;
|
||||
sc.ShipcallControlModel = selectedSCMModel;
|
||||
ShipcallControl sc = new()
|
||||
{
|
||||
Height = 120,
|
||||
ShipcallControlModel = selectedSCMModel
|
||||
};
|
||||
sc.TimesRequested += Sc_TimesRequested;
|
||||
sc.EditRequested += Sc_EditRequested;
|
||||
this.stackPanel.Children.Add(sc);
|
||||
@ -213,9 +314,7 @@ namespace BreCalClient
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>0.3.0.0</ApplicationVersion>
|
||||
<BootstrapperEnabled>False</BootstrapperEnabled>
|
||||
<Configuration>Release</Configuration>
|
||||
<CreateWebPageOnPublish>True</CreateWebPageOnPublish>
|
||||
<GenerateManifests>true</GenerateManifests>
|
||||
<Install>True</Install>
|
||||
<InstallFrom>Web</InstallFrom>
|
||||
<InstallUrl>https://www.bsmd-emswe.eu/client/</InstallUrl>
|
||||
<IsRevisionIncremented>False</IsRevisionIncremented>
|
||||
<IsWebBootstrapper>True</IsWebBootstrapper>
|
||||
<MapFileExtensions>True</MapFileExtensions>
|
||||
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net6.0-windows\app.publish\</PublishDir>
|
||||
<PublishUrl>bin\publish\</PublishUrl>
|
||||
<PublishProtocol>ClickOnce</PublishProtocol>
|
||||
<PublishReadyToRun>False</PublishReadyToRun>
|
||||
<PublishSingleFile>False</PublishSingleFile>
|
||||
<SelfContained>False</SelfContained>
|
||||
<SignatureAlgorithm>(none)</SignatureAlgorithm>
|
||||
<SignManifests>False</SignManifests>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<UpdateEnabled>True</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateRequired>False</UpdateRequired>
|
||||
<WebPageFileName>Publish.html</WebPageFileName>
|
||||
<CreateDesktopShortcut>True</CreateDesktopShortcut>
|
||||
<ErrorReportUrl>https://www.bsmd-emswe.eu/</ErrorReportUrl>
|
||||
<ProductName>BreCalClient</ProductName>
|
||||
<PublisherName>Informatikbüro Daniel Schick</PublisherName>
|
||||
<SuiteName>Bremen calling client</SuiteName>
|
||||
<SupportUrl>https://www.bsmd-emswe.eu/</SupportUrl>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.6.0.x64">
|
||||
<Install>true</Install>
|
||||
<ProductName>.NET Desktop Runtime 6.0.16 (x64)</ProductName>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
298
src/BreCalClient/Resources/Resources.Designer.cs
generated
298
src/BreCalClient/Resources/Resources.Designer.cs
generated
@ -140,6 +140,16 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] containership1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("containership1", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
@ -188,6 +198,24 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Anchored.
|
||||
/// </summary>
|
||||
public static string textAnchored {
|
||||
get {
|
||||
return ResourceManager.GetString("textAnchored", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Arrival terminal.
|
||||
/// </summary>
|
||||
public static string textArrivalTerminal {
|
||||
get {
|
||||
return ResourceManager.GetString("textArrivalTerminal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Berth.
|
||||
/// </summary>
|
||||
@ -206,6 +234,15 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bunkering.
|
||||
/// </summary>
|
||||
public static string textBunkering {
|
||||
get {
|
||||
return ResourceManager.GetString("textBunkering", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Callsign.
|
||||
/// </summary>
|
||||
@ -215,6 +252,24 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
public static string textCancel {
|
||||
get {
|
||||
return ResourceManager.GetString("textCancel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancelled.
|
||||
/// </summary>
|
||||
public static string textCancelled {
|
||||
get {
|
||||
return ResourceManager.GetString("textCancelled", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Categories.
|
||||
/// </summary>
|
||||
@ -224,6 +279,60 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Change.
|
||||
/// </summary>
|
||||
public static string textChange {
|
||||
get {
|
||||
return ResourceManager.GetString("textChange", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Change password.
|
||||
/// </summary>
|
||||
public static string textChangePassword {
|
||||
get {
|
||||
return ResourceManager.GetString("textChangePassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Close.
|
||||
/// </summary>
|
||||
public static string textClose {
|
||||
get {
|
||||
return ResourceManager.GetString("textClose", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Departure terminal.
|
||||
/// </summary>
|
||||
public static string textDepartureTerminal {
|
||||
get {
|
||||
return ResourceManager.GetString("textDepartureTerminal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Draft.
|
||||
/// </summary>
|
||||
public static string textDraft {
|
||||
get {
|
||||
return ResourceManager.GetString("textDraft", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Edit ship call.
|
||||
/// </summary>
|
||||
public static string textEditShipcall {
|
||||
get {
|
||||
return ResourceManager.GetString("textEditShipcall", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enter keyword.
|
||||
/// </summary>
|
||||
@ -278,6 +387,24 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Moored in lock.
|
||||
/// </summary>
|
||||
public static string textMooredLock {
|
||||
get {
|
||||
return ResourceManager.GetString("textMooredLock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Mooring.
|
||||
/// </summary>
|
||||
public static string textMooring {
|
||||
get {
|
||||
return ResourceManager.GetString("textMooring", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to New...
|
||||
/// </summary>
|
||||
@ -287,6 +414,42 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to New password.
|
||||
/// </summary>
|
||||
public static string textNewPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("textNewPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
public static string textOK {
|
||||
get {
|
||||
return ResourceManager.GetString("textOK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Old password.
|
||||
/// </summary>
|
||||
public static string textOldPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("textOldPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Participants.
|
||||
/// </summary>
|
||||
public static string textParticipants {
|
||||
get {
|
||||
return ResourceManager.GetString("textParticipants", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password.
|
||||
/// </summary>
|
||||
@ -296,6 +459,78 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pier side.
|
||||
/// </summary>
|
||||
public static string textPierside {
|
||||
get {
|
||||
return ResourceManager.GetString("textPierside", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pilot.
|
||||
/// </summary>
|
||||
public static string textPilot {
|
||||
get {
|
||||
return ResourceManager.GetString("textPilot", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pilot required.
|
||||
/// </summary>
|
||||
public static string textPilotRequired {
|
||||
get {
|
||||
return ResourceManager.GetString("textPilotRequired", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Rain sensitive cargo.
|
||||
/// </summary>
|
||||
public static string textRainSensitiveCargo {
|
||||
get {
|
||||
return ResourceManager.GetString("textRainSensitiveCargo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Recommended tugs.
|
||||
/// </summary>
|
||||
public static string textRecommendedTugs {
|
||||
get {
|
||||
return ResourceManager.GetString("textRecommendedTugs", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Repeat new password.
|
||||
/// </summary>
|
||||
public static string textRepeatNewPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("textRepeatNewPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Replenishing lock.
|
||||
/// </summary>
|
||||
public static string textReplenishingLock {
|
||||
get {
|
||||
return ResourceManager.GetString("textReplenishingLock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Replenishing terminal.
|
||||
/// </summary>
|
||||
public static string textReplenishingTerminal {
|
||||
get {
|
||||
return ResourceManager.GetString("textReplenishingTerminal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Search.
|
||||
/// </summary>
|
||||
@ -305,6 +540,15 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Ship.
|
||||
/// </summary>
|
||||
public static string textShip {
|
||||
get {
|
||||
return ResourceManager.GetString("textShip", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Ship length.
|
||||
/// </summary>
|
||||
@ -323,6 +567,24 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Terminal.
|
||||
/// </summary>
|
||||
public static string textTerminal {
|
||||
get {
|
||||
return ResourceManager.GetString("textTerminal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Tidal window.
|
||||
/// </summary>
|
||||
public static string textTidalWindow {
|
||||
get {
|
||||
return ResourceManager.GetString("textTidalWindow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to to.
|
||||
/// </summary>
|
||||
@ -332,6 +594,33 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Tug.
|
||||
/// </summary>
|
||||
public static string textTug {
|
||||
get {
|
||||
return ResourceManager.GetString("textTug", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Tug required.
|
||||
/// </summary>
|
||||
public static string textTugRequired {
|
||||
get {
|
||||
return ResourceManager.GetString("textTugRequired", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Type.
|
||||
/// </summary>
|
||||
public static string textType {
|
||||
get {
|
||||
return ResourceManager.GetString("textType", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User login.
|
||||
/// </summary>
|
||||
@ -350,6 +639,15 @@ namespace BreCalClient.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Voyage.
|
||||
/// </summary>
|
||||
public static string textVoyage {
|
||||
get {
|
||||
return ResourceManager.GetString("textVoyage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
|
||||
@ -151,18 +151,51 @@
|
||||
<data name="textAgency" xml:space="preserve">
|
||||
<value>Agentur</value>
|
||||
</data>
|
||||
<data name="textAnchored" xml:space="preserve">
|
||||
<value>Ankerorder</value>
|
||||
</data>
|
||||
<data name="textArrivalTerminal" xml:space="preserve">
|
||||
<value>Terminal Ankunft</value>
|
||||
</data>
|
||||
<data name="textBerth" xml:space="preserve">
|
||||
<value>Liegeplatz</value>
|
||||
</data>
|
||||
<data name="textBerths" xml:space="preserve">
|
||||
<value>Liegeplätze</value>
|
||||
</data>
|
||||
<data name="textBunkering" xml:space="preserve">
|
||||
<value>Bunkeraufnahme</value>
|
||||
</data>
|
||||
<data name="textCallsign" xml:space="preserve">
|
||||
<value>Rufzeichen</value>
|
||||
</data>
|
||||
<data name="textCancel" xml:space="preserve">
|
||||
<value>Abbrechen</value>
|
||||
</data>
|
||||
<data name="textCancelled" xml:space="preserve">
|
||||
<value>Annulliert</value>
|
||||
</data>
|
||||
<data name="textCategories" xml:space="preserve">
|
||||
<value>Kategorien</value>
|
||||
</data>
|
||||
<data name="textChange" xml:space="preserve">
|
||||
<value>Ändern</value>
|
||||
</data>
|
||||
<data name="textChangePassword" xml:space="preserve">
|
||||
<value>Password ändern</value>
|
||||
</data>
|
||||
<data name="textClose" xml:space="preserve">
|
||||
<value>Schliessen</value>
|
||||
</data>
|
||||
<data name="textDepartureTerminal" xml:space="preserve">
|
||||
<value>Terminal Abfahrt</value>
|
||||
</data>
|
||||
<data name="textDraft" xml:space="preserve">
|
||||
<value>Tiefgang</value>
|
||||
</data>
|
||||
<data name="textEditShipcall" xml:space="preserve">
|
||||
<value>Schiffsanlauf bearbeiten</value>
|
||||
</data>
|
||||
<data name="textEnterKeyword" xml:space="preserve">
|
||||
<value>Suchbegriff eingeben</value>
|
||||
</data>
|
||||
@ -181,30 +214,93 @@
|
||||
<data name="textLogin" xml:space="preserve">
|
||||
<value>Anmelden</value>
|
||||
</data>
|
||||
<data name="textMooredLock" xml:space="preserve">
|
||||
<value>Festmacher in Schleuse</value>
|
||||
</data>
|
||||
<data name="textMooring" xml:space="preserve">
|
||||
<value>Festmacher</value>
|
||||
</data>
|
||||
<data name="textNewDots" xml:space="preserve">
|
||||
<value>Neu..</value>
|
||||
</data>
|
||||
<data name="textNewPassword" xml:space="preserve">
|
||||
<value>Neues Passwort</value>
|
||||
</data>
|
||||
<data name="textOK" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="textOldPassword" xml:space="preserve">
|
||||
<value>Altes Passwort</value>
|
||||
</data>
|
||||
<data name="textParticipants" xml:space="preserve">
|
||||
<value>Teilnehmer</value>
|
||||
</data>
|
||||
<data name="textPassword" xml:space="preserve">
|
||||
<value>Passwort</value>
|
||||
</data>
|
||||
<data name="textPierside" xml:space="preserve">
|
||||
<value>Anlegeseite</value>
|
||||
</data>
|
||||
<data name="textPilot" xml:space="preserve">
|
||||
<value>Lotse</value>
|
||||
</data>
|
||||
<data name="textPilotRequired" xml:space="preserve">
|
||||
<value>Lotsorder</value>
|
||||
</data>
|
||||
<data name="textRainSensitiveCargo" xml:space="preserve">
|
||||
<value>Regensensitive Ladung</value>
|
||||
</data>
|
||||
<data name="textRecommendedTugs" xml:space="preserve">
|
||||
<value>Anzahl Schlepper</value>
|
||||
</data>
|
||||
<data name="textRepeatNewPassword" xml:space="preserve">
|
||||
<value>Neues Passwort wiederholen</value>
|
||||
</data>
|
||||
<data name="textReplenishingLock" xml:space="preserve">
|
||||
<value>Versorgungsaufnahme Schleuse</value>
|
||||
</data>
|
||||
<data name="textReplenishingTerminal" xml:space="preserve">
|
||||
<value>Versorgungsaufnahme Terminal</value>
|
||||
</data>
|
||||
<data name="textSearch" xml:space="preserve">
|
||||
<value>Suche</value>
|
||||
</data>
|
||||
<data name="textShip" xml:space="preserve">
|
||||
<value>Schiff</value>
|
||||
</data>
|
||||
<data name="textShipLength" xml:space="preserve">
|
||||
<value>Schiffslänge</value>
|
||||
</data>
|
||||
<data name="textSortOrder" xml:space="preserve">
|
||||
<value>Sortierung</value>
|
||||
</data>
|
||||
<data name="textTerminal" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="textTidalWindow" xml:space="preserve">
|
||||
<value>Tidenfenster</value>
|
||||
</data>
|
||||
<data name="textTo" xml:space="preserve">
|
||||
<value>bis</value>
|
||||
</data>
|
||||
<data name="textTug" xml:space="preserve">
|
||||
<value>Schlepper</value>
|
||||
</data>
|
||||
<data name="textTugRequired" xml:space="preserve">
|
||||
<value>Schlepperorder</value>
|
||||
</data>
|
||||
<data name="textType" xml:space="preserve">
|
||||
<value>Typ</value>
|
||||
</data>
|
||||
<data name="textUserlogin" xml:space="preserve">
|
||||
<value>Anmeldung</value>
|
||||
</data>
|
||||
<data name="textUsername" xml:space="preserve">
|
||||
<value>Benutzername</value>
|
||||
</data>
|
||||
<data name="textVoyage" xml:space="preserve">
|
||||
<value>Reise</value>
|
||||
</data>
|
||||
<data name="trafficlight_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
|
||||
@ -142,6 +142,9 @@
|
||||
<data name="containership" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>containership.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="containership1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>containership.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="emergency_stop_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>emergency_stop_button.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
@ -157,18 +160,51 @@
|
||||
<data name="textAgency" xml:space="preserve">
|
||||
<value>Agency</value>
|
||||
</data>
|
||||
<data name="textAnchored" xml:space="preserve">
|
||||
<value>Anchored</value>
|
||||
</data>
|
||||
<data name="textArrivalTerminal" xml:space="preserve">
|
||||
<value>Arrival terminal</value>
|
||||
</data>
|
||||
<data name="textBerth" xml:space="preserve">
|
||||
<value>Berth</value>
|
||||
</data>
|
||||
<data name="textBerths" xml:space="preserve">
|
||||
<value>Berths</value>
|
||||
</data>
|
||||
<data name="textBunkering" xml:space="preserve">
|
||||
<value>Bunkering</value>
|
||||
</data>
|
||||
<data name="textCallsign" xml:space="preserve">
|
||||
<value>Callsign</value>
|
||||
</data>
|
||||
<data name="textCancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="textCancelled" xml:space="preserve">
|
||||
<value>Cancelled</value>
|
||||
</data>
|
||||
<data name="textCategories" xml:space="preserve">
|
||||
<value>Categories</value>
|
||||
</data>
|
||||
<data name="textChange" xml:space="preserve">
|
||||
<value>Change</value>
|
||||
</data>
|
||||
<data name="textChangePassword" xml:space="preserve">
|
||||
<value>Change password</value>
|
||||
</data>
|
||||
<data name="textClose" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
</data>
|
||||
<data name="textDepartureTerminal" xml:space="preserve">
|
||||
<value>Departure terminal</value>
|
||||
</data>
|
||||
<data name="textDraft" xml:space="preserve">
|
||||
<value>Draft</value>
|
||||
</data>
|
||||
<data name="textEditShipcall" xml:space="preserve">
|
||||
<value>Edit ship call</value>
|
||||
</data>
|
||||
<data name="textEnterKeyword" xml:space="preserve">
|
||||
<value>Enter keyword</value>
|
||||
</data>
|
||||
@ -187,30 +223,93 @@
|
||||
<data name="textLogin" xml:space="preserve">
|
||||
<value>Login</value>
|
||||
</data>
|
||||
<data name="textMooredLock" xml:space="preserve">
|
||||
<value>Moored in lock</value>
|
||||
</data>
|
||||
<data name="textMooring" xml:space="preserve">
|
||||
<value>Mooring</value>
|
||||
</data>
|
||||
<data name="textNewDots" xml:space="preserve">
|
||||
<value>New..</value>
|
||||
</data>
|
||||
<data name="textNewPassword" xml:space="preserve">
|
||||
<value>New password</value>
|
||||
</data>
|
||||
<data name="textOK" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="textOldPassword" xml:space="preserve">
|
||||
<value>Old password</value>
|
||||
</data>
|
||||
<data name="textParticipants" xml:space="preserve">
|
||||
<value>Participants</value>
|
||||
</data>
|
||||
<data name="textPassword" xml:space="preserve">
|
||||
<value>Password</value>
|
||||
</data>
|
||||
<data name="textPierside" xml:space="preserve">
|
||||
<value>Pier side</value>
|
||||
</data>
|
||||
<data name="textPilot" xml:space="preserve">
|
||||
<value>Pilot</value>
|
||||
</data>
|
||||
<data name="textPilotRequired" xml:space="preserve">
|
||||
<value>Pilot required</value>
|
||||
</data>
|
||||
<data name="textRainSensitiveCargo" xml:space="preserve">
|
||||
<value>Rain sensitive cargo</value>
|
||||
</data>
|
||||
<data name="textRecommendedTugs" xml:space="preserve">
|
||||
<value>Recommended tugs</value>
|
||||
</data>
|
||||
<data name="textRepeatNewPassword" xml:space="preserve">
|
||||
<value>Repeat new password</value>
|
||||
</data>
|
||||
<data name="textReplenishingLock" xml:space="preserve">
|
||||
<value>Replenishing lock</value>
|
||||
</data>
|
||||
<data name="textReplenishingTerminal" xml:space="preserve">
|
||||
<value>Replenishing terminal</value>
|
||||
</data>
|
||||
<data name="textSearch" xml:space="preserve">
|
||||
<value>Search</value>
|
||||
</data>
|
||||
<data name="textShip" xml:space="preserve">
|
||||
<value>Ship</value>
|
||||
</data>
|
||||
<data name="textShipLength" xml:space="preserve">
|
||||
<value>Ship length</value>
|
||||
</data>
|
||||
<data name="textSortOrder" xml:space="preserve">
|
||||
<value>Sort order</value>
|
||||
</data>
|
||||
<data name="textTerminal" xml:space="preserve">
|
||||
<value>Terminal</value>
|
||||
</data>
|
||||
<data name="textTidalWindow" xml:space="preserve">
|
||||
<value>Tidal window</value>
|
||||
</data>
|
||||
<data name="textTo" xml:space="preserve">
|
||||
<value>to</value>
|
||||
</data>
|
||||
<data name="textTug" xml:space="preserve">
|
||||
<value>Tug</value>
|
||||
</data>
|
||||
<data name="textTugRequired" xml:space="preserve">
|
||||
<value>Tug required</value>
|
||||
</data>
|
||||
<data name="textType" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
<data name="textUserlogin" xml:space="preserve">
|
||||
<value>User login</value>
|
||||
</data>
|
||||
<data name="textUsername" xml:space="preserve">
|
||||
<value>User name</value>
|
||||
</data>
|
||||
<data name="textVoyage" xml:space="preserve">
|
||||
<value>Voyage</value>
|
||||
</data>
|
||||
<data name="trafficlight_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
|
||||
BIN
src/BreCalClient/Resources/containership.ico
Normal file
BIN
src/BreCalClient/Resources/containership.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
@ -7,7 +7,7 @@
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="56" d:DesignWidth="800">
|
||||
d:DesignHeight="56" d:DesignWidth="800" Loaded="UserControl_Loaded">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
@ -27,7 +27,7 @@
|
||||
<Image Grid.Column="0" Grid.RowSpan="2" x:Name="logoImage" Source="Resources/logo_bremen_calling.png" Stretch="Fill" MouseUp="logoImage_MouseUp" Margin="0"/>
|
||||
|
||||
<!-- Labels -->
|
||||
<Label Grid.Row="0" Grid.Column="1">
|
||||
<Label Grid.Row="0" Grid.Column="1" HorizontalContentAlignment="Right">
|
||||
<TextBlock>
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} {1}">
|
||||
@ -37,8 +37,8 @@
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Label>
|
||||
<Label Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textCategories}" />
|
||||
<Label Grid.Row="0" Grid.Column="5">
|
||||
<Label Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textCategories}" HorizontalContentAlignment="Right" />
|
||||
<Label Grid.Row="0" Grid.Column="5" HorizontalContentAlignment="Right">
|
||||
<TextBlock>
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} {1}">
|
||||
@ -48,9 +48,9 @@
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</Label>
|
||||
<Label Grid.Row="1" Grid.Column="1" Content="{x:Static p:Resources.textSearch}" />
|
||||
<Label Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textBerths}" />
|
||||
<Label Grid.Row="1" Grid.Column="5" Content="{x:Static p:Resources.textAgencies}" />
|
||||
<Label Grid.Row="1" Grid.Column="1" Content="{x:Static p:Resources.textSearch}" HorizontalContentAlignment="Right"/>
|
||||
<Label Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textBerths}" HorizontalContentAlignment="Right"/>
|
||||
<Label Grid.Row="1" Grid.Column="5" Content="{x:Static p:Resources.textAgencies}" HorizontalContentAlignment="Right"/>
|
||||
|
||||
<!-- Filter input controls -->
|
||||
<Grid Grid.Column="2" Grid.Row="0">
|
||||
@ -75,7 +75,7 @@
|
||||
<xctk:DoubleUpDown x:Name="upDownShiplengthTo" Grid.Column="2" Margin="2" Minimum="0" Maximum="1000"/>
|
||||
</Grid>
|
||||
<xctk:WatermarkTextBox x:Name="textBoxSearch" Grid.Column="2" Grid.Row="1" Margin="2" Watermark="{x:Static p:Resources.textEnterKeyword}" />
|
||||
<xctk:CheckComboBox x:Name="comboBoxBerths" Grid.Column="4" Grid.Row="1" Margin="2" />
|
||||
<xctk:CheckComboBox x:Name="comboBoxAgencies" Grid.Column="6" Grid.Row="1" Margin="2" />
|
||||
<xctk:CheckComboBox x:Name="comboBoxBerths" DisplayMemberPath="Name" Grid.Column="4" Grid.Row="1" Margin="2" />
|
||||
<xctk:CheckComboBox x:Name="comboBoxAgencies" DisplayMemberPath="Name" Grid.Column="6" Grid.Row="1" Margin="2" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@ -54,7 +54,12 @@ namespace BreCalClient
|
||||
|
||||
private void logoImage_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (LogoImageClicked != null) LogoImageClicked();
|
||||
LogoImageClicked?.Invoke();
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(Shipcall.TypeEnum));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
||||
xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
|
||||
xmlns:db2="clr-namespace:BreCalClient.misc.Model;assembly=BreCalClient"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="120" d:DesignWidth="800" Loaded="UserControl_Loaded">
|
||||
<Border BorderBrush="LightGray" Margin="1" BorderThickness="1">
|
||||
@ -39,10 +40,32 @@
|
||||
<ColumnDefinition Width=".4*" />
|
||||
<ColumnDefinition Width=".6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="2" FontSize="10" Content="{Binding Ship.Name}" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="30" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Margin="2" Grid.Column="0" >
|
||||
<Image.Style>
|
||||
<Style TargetType="Image">
|
||||
<Setter Property="Source" Value="{Binding Shipcall.Type}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Incoming}">
|
||||
<Setter Property="Source" Value="./Resources/arrow_down_red.png"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Outgoing}">
|
||||
<Setter Property="Source" Value="./Resources/arrow_up_green.png"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Shipcall.Type}" Value="{x:Static db2:Shipcall+TypeEnum.Shifting}">
|
||||
<Setter Property="Source" Value="./Resources/arrow_right_blue.png"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
<Label Grid.Column="1" FontSize="10" Content="{Binding Ship.Name}" Foreground="White" Background="#203864" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
|
||||
|
||||
</Grid>
|
||||
<Viewbox Grid.Row="1" Grid.Column="0">
|
||||
<TextBlock Text="IMO" />
|
||||
</Viewbox>
|
||||
|
||||
@ -79,26 +79,17 @@ namespace BreCalClient
|
||||
|
||||
private void buttonListTimes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(this.TimesRequested != null)
|
||||
{
|
||||
this.TimesRequested(this);
|
||||
}
|
||||
this.TimesRequested?.Invoke(this);
|
||||
}
|
||||
|
||||
private void buttonEditShipcall_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.EditRequested != null)
|
||||
{
|
||||
this.EditRequested(this);
|
||||
}
|
||||
this.EditRequested?.Invoke(this);
|
||||
}
|
||||
|
||||
private void buttonOpenDropDown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(this.OpenExtraRequested != null)
|
||||
{
|
||||
this.OpenExtraRequested(this);
|
||||
}
|
||||
this.OpenExtraRequested?.Invoke(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
BIN
src/BreCalClient/containership.ico
Normal file
BIN
src/BreCalClient/containership.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
4
src/RoleEditor/.editorconfig
Normal file
4
src/RoleEditor/.editorconfig
Normal file
@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# Default severity for all analyzer diagnostics
|
||||
dotnet_analyzer_diagnostic.severity = none
|
||||
@ -14,6 +14,9 @@ using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using brecal.model;
|
||||
using brecal.mysql;
|
||||
using ExcelDataReader;
|
||||
using Microsoft.Win32;
|
||||
|
||||
|
||||
namespace RoleEditor
|
||||
{
|
||||
@ -572,7 +575,57 @@ namespace RoleEditor
|
||||
|
||||
private void buttonImportBerths_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog
|
||||
{
|
||||
Filter = "Excel Files|*.xls;*.xlsx"
|
||||
};
|
||||
if (ofd.ShowDialog() ?? false)
|
||||
{
|
||||
FileStream stream;
|
||||
try
|
||||
{
|
||||
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
List<Berth> importBerthList = new();
|
||||
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.FieldCount < 2)
|
||||
{
|
||||
throw new InvalidDataException("Sheet must have at least 2 Columns of data");
|
||||
}
|
||||
Berth b = new Berth();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) b.Name = reader.GetString(0);
|
||||
string participant_name;
|
||||
if (!reader.IsDBNull(1)) participant_name = reader.GetString(1);
|
||||
|
||||
importBerthList.Add(b);
|
||||
}
|
||||
} while (reader.NextResult());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error reading Excel: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonImportShipss_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
||||
<PackageReference Include="ExcelDataReader" Version="3.7.0-develop00385" />
|
||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@ -7,7 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoleEditor", "RoleEditor.cs
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "brecal.model", "..\brecal.model\brecal.model.csproj", "{F3BC5ADC-BF57-47DC-A5D5-CC4A13857DEE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "brecal.mysql", "..\brecal.mysql\brecal.mysql.csproj", "{E88F908B-48C9-46BD-A3AE-C36FBE9EDF1F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "brecal.mysql", "..\brecal.mysql\brecal.mysql.csproj", "{E88F908B-48C9-46BD-A3AE-C36FBE9EDF1F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{17164AE2-AB25-4394-A865-4A8CF524D6DA}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@ -11,6 +11,7 @@ from .api import notifications
|
||||
from .api import berths
|
||||
from .api import ships
|
||||
from .api import login
|
||||
from .api import user
|
||||
|
||||
sessions = dict()
|
||||
|
||||
@ -39,6 +40,7 @@ def create_app(test_config=None):
|
||||
app.register_blueprint(berths.bp)
|
||||
app.register_blueprint(ships.bp)
|
||||
app.register_blueprint(login.bp)
|
||||
app.register_blueprint(user.bp)
|
||||
|
||||
|
||||
logging.basicConfig(filename='brecal.log', level=logging.DEBUG, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s')
|
||||
|
||||
24
src/server/BreCal/api/user.py
Normal file
24
src/server/BreCal/api/user.py
Normal file
@ -0,0 +1,24 @@
|
||||
from flask import Blueprint, request
|
||||
from ..schemas import model
|
||||
from .. import impl
|
||||
from ..services.auth_guard import auth_guard
|
||||
import json
|
||||
import logging
|
||||
|
||||
bp = Blueprint('user', __name__)
|
||||
|
||||
@bp.route('/user', methods=['put'])
|
||||
@auth_guard() # no restriction by role
|
||||
def PutUser():
|
||||
|
||||
try:
|
||||
content = request.get_json(force=True)
|
||||
loadedModel = model.UserSchema().load(data=content, many=False, partial=True)
|
||||
|
||||
except Exception as ex:
|
||||
logging.error(ex)
|
||||
print(ex)
|
||||
return json.dumps("bad format"), 400
|
||||
|
||||
return impl.user.PutUser(loadedModel)
|
||||
|
||||
@ -5,3 +5,4 @@ from . import shipcalls
|
||||
from . import times
|
||||
from . import ships
|
||||
from . import login
|
||||
from . import user
|
||||
@ -15,7 +15,7 @@ def GetBerths(token):
|
||||
try:
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
data = commands.query("SELECT id, name, participant_id, `lock`, created, modified FROM berth ORDER BY name", model=model.Berth)
|
||||
data = commands.query("SELECT id, name, participant_id, `lock`, created, modified, deleted FROM berth ORDER BY name", model=model.Berth)
|
||||
pooledConnection.close()
|
||||
|
||||
except Exception as ex:
|
||||
|
||||
@ -14,7 +14,7 @@ def GetUser(options):
|
||||
hash = bcrypt.hashpw(options["password"].encode('utf-8'), bcrypt.gensalt( 12 )).decode('utf8')
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
data = commands.query("SELECT id, participant_id, first_name, last_name, user_name, user_email, user_phone, password_hash, api_key FROM user WHERE user_name = ?username? OR user_email = ?username?",
|
||||
data = commands.query("SELECT id, participant_id, first_name, last_name, user_name, user_email, user_phone, password_hash, api_key, created, modified FROM user WHERE user_name = ?username? OR user_email = ?username?",
|
||||
model=model.User, param={"username" : options["username"]})
|
||||
pooledConnection.close()
|
||||
# print(data)
|
||||
|
||||
@ -17,9 +17,9 @@ def GetParticipant(options):
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
if "user_id" in options and options["user_id"]:
|
||||
data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified FROM participant p INNER JOIN user u WHERE u.participant_id = p.id and u.id = ?userid?", model=model.Participant, param={"userid" : options["user_id"]})
|
||||
data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified, p.deleted as deleted FROM participant p INNER JOIN user u WHERE u.participant_id = p.id and u.id = ?userid?", model=model.Participant, param={"userid" : options["user_id"]})
|
||||
else:
|
||||
data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified FROM participant p ORDER BY p.name", model=model.Participant)
|
||||
data = commands.query("SELECT id, name, street, postal_code, city, type, flags, created, modified, deleted FROM participant p ORDER BY p.name", model=model.Participant)
|
||||
pooledConnection.close()
|
||||
|
||||
except Exception as ex:
|
||||
|
||||
@ -18,8 +18,8 @@ def GetShipcalls(options):
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
data = commands.query("SELECT id, ship_id, type, eta, voyage, etd, arrival_berth_id, departure_berth_id, tug_required, pilot_required, " +
|
||||
"flags, pier_side, bunkering, replenishing, draft, tidal_window_from, tidal_window_to, rain_sensitive_cargo, recommended_tugs, " +
|
||||
"created, modified FROM shipcall WHERE eta IS NULL OR eta >= DATE(NOW() - INTERVAL 2 DAY) " +
|
||||
"flags, pier_side, bunkering, replenishing_terminal, replenishing_lock, draft, tidal_window_from, tidal_window_to, rain_sensitive_cargo, recommended_tugs, " +
|
||||
"anchored, moored_lock, canceled, created, modified FROM shipcall WHERE eta IS NULL OR eta >= DATE(NOW() - INTERVAL 2 DAY) " +
|
||||
"ORDER BY eta", model=model.Shipcall)
|
||||
for shipcall in data:
|
||||
participant_query = "SELECT participant_id FROM shipcall_participant_map WHERE shipcall_id=?shipcall_id?";
|
||||
|
||||
@ -16,7 +16,7 @@ def GetShips(token):
|
||||
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
data = commands.query("SELECT id, name, imo, callsign, participant_id, length, width, created, modified FROM ship ORDER BY name", model=model.Ship)
|
||||
data = commands.query("SELECT id, name, imo, callsign, participant_id, length, width, is_tug, bollard_pull, eni, created, modified, deleted FROM ship ORDER BY name", model=model.Ship)
|
||||
pooledConnection.close()
|
||||
|
||||
except Exception as ex:
|
||||
|
||||
@ -18,7 +18,8 @@ def GetTimes(options):
|
||||
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
data = commands.query("SELECT id, start_planned, end_planned, duration_planned, start_actual, end_actual, duration_actual, shipcall_id, participant_id, created, modified FROM times " +
|
||||
data = commands.query("SELECT id, eta_berth, eta_berth_fixed, etd_berth, etd_berth_fixed, lock_time, lock_time_fixed, " +
|
||||
"zone_entry, zone_entry_fixed, operations_start, operations_end, remarks, shipcall_id, participant_id, created, modified FROM times " +
|
||||
"WHERE times.shipcall_id = ?scid?", model=model.Times, param={"scid" : options["shipcall_id"]})
|
||||
pooledConnection.close()
|
||||
|
||||
|
||||
71
src/server/BreCal/impl/user.py
Normal file
71
src/server/BreCal/impl/user.py
Normal file
@ -0,0 +1,71 @@
|
||||
import json
|
||||
import logging
|
||||
import pydapper
|
||||
import bcrypt
|
||||
|
||||
from ..schemas import model
|
||||
from .. import local_db
|
||||
|
||||
def PutUser(schemaModel):
|
||||
"""
|
||||
|
||||
:param schemaModel: The deserialized dict of the request
|
||||
"""
|
||||
|
||||
# This updates an *existing* entry
|
||||
try:
|
||||
|
||||
pooledConnection = local_db.getPoolConnection()
|
||||
commands = pydapper.using(pooledConnection)
|
||||
|
||||
# test if object to update is found
|
||||
|
||||
sentinel = object()
|
||||
theuser = commands.query_single_or_default("SELECT * FROM user where id = ?id?", sentinel, param={"id" : schemaModel["id"]}, model=model.User)
|
||||
if theuser is sentinel:
|
||||
pooledConnection.close()
|
||||
return json.dumps("no such record"), 404, {'Content-Type': 'application/json; charset=utf-8'}
|
||||
|
||||
# see if we need to update public fields
|
||||
if "first_name" in schemaModel or "last_name" in schemaModel or "user_phone" in schemaModel:
|
||||
query = "UPDATE user SET "
|
||||
isNotFirst = False
|
||||
for key in schemaModel.keys():
|
||||
if key == "id":
|
||||
continue
|
||||
if key == "old_password":
|
||||
continue
|
||||
if key == "new_password":
|
||||
continue
|
||||
if isNotFirst:
|
||||
query += ", "
|
||||
isNotFirst = True
|
||||
query += key + " = ?" + key + "? "
|
||||
|
||||
query += "WHERE id = ?id?"
|
||||
affected_rows = commands.execute(query, param=schemaModel)
|
||||
|
||||
# update password if available and old pw is (correctly!) given
|
||||
if "old_password" in schemaModel and schemaModel["old_password"] and "new_password" in schemaModel and schemaModel["new_password"]:
|
||||
if bcrypt.checkpw(schemaModel["old_password"].encode("utf-8"), bytes(theuser.password_hash, "utf-8")): # old pw matches
|
||||
password_hash = bcrypt.hashpw(schemaModel["new_password"].encode('utf-8'), bcrypt.gensalt( 12 )).decode('utf8')
|
||||
query = "UPDATE user SET password_hash = ?password_hash? WHERE id = ?id?"
|
||||
commands.execute(query, param={"password_hash" : password_hash, "id" : schemaModel["id"]})
|
||||
else:
|
||||
result = {}
|
||||
result["message"] = "old password invalid"
|
||||
return json.dumps(result), 400, {'Content-Type': 'application/json; charset=utf-8'}
|
||||
|
||||
pooledConnection.close()
|
||||
|
||||
return json.dumps({"id" : schemaModel["id"]}), 200
|
||||
|
||||
except Exception as ex:
|
||||
logging.error(ex)
|
||||
print(ex)
|
||||
result = {}
|
||||
result["message"] = "call failed"
|
||||
return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'}
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ class Berth(Schema):
|
||||
lock: bool
|
||||
created: datetime
|
||||
modified: datetime
|
||||
deleted: bool
|
||||
|
||||
class Error(Schema):
|
||||
message = fields.String(required=True,)
|
||||
@ -50,6 +51,7 @@ class Participant(Schema):
|
||||
flags: int
|
||||
created: datetime
|
||||
modified: datetime
|
||||
deleted: bool
|
||||
|
||||
class ParticipantList(Participant):
|
||||
pass
|
||||
@ -73,12 +75,16 @@ class ShipcallSchema(Schema):
|
||||
flags = fields.Int()
|
||||
pier_side = fields.Bool()
|
||||
bunkering = fields.Bool()
|
||||
replenishing = fields.Bool()
|
||||
replenishing_terminal = fields.Bool()
|
||||
replenishing_lock = fields.Bool()
|
||||
draft = fields.Float()
|
||||
tidal_window_from = fields.DateTime()
|
||||
tidal_window_to = fields.DateTime()
|
||||
rain_sensitive_cargo = fields.Bool()
|
||||
recommended_tugs = fields.Int()
|
||||
anchored = fields.Bool()
|
||||
moored_lock = fields.Bool()
|
||||
canceled = fields.Bool()
|
||||
participants = fields.List(fields.Int)
|
||||
created = fields.DateTime()
|
||||
modified = fields.DateTime()
|
||||
@ -99,12 +105,16 @@ class Shipcall:
|
||||
flags: int
|
||||
pier_side: bool
|
||||
bunkering: bool
|
||||
replenishing: bool
|
||||
replenishing_terminal: bool
|
||||
replenishing_lock: bool
|
||||
draft: float
|
||||
tidal_window_from: datetime
|
||||
tidal_window_to: datetime
|
||||
rain_sensitive_cargo: bool
|
||||
recommended_tugs: int
|
||||
anchored: bool
|
||||
moored_lock: bool
|
||||
canceled: bool
|
||||
created: datetime
|
||||
modified: datetime
|
||||
participants: List[int] = field(default_factory=list)
|
||||
@ -120,27 +130,50 @@ class TimesSchema(Schema):
|
||||
pass
|
||||
|
||||
id = fields.Int(Required=False)
|
||||
start_planned = fields.DateTime(Required=False)
|
||||
end_planned = fields.DateTime(Required = False)
|
||||
duration_planned = fields.Int(Required = False)
|
||||
start_actual = fields.DateTime(Required = False)
|
||||
end_actual = fields.DateTime(Required = False)
|
||||
duration_actual = fields.Int(Required = False)
|
||||
eta_berth = fields.DateTime(Required = False)
|
||||
eta_berth_fixed = fields.Bool(Required = False)
|
||||
etd_berth = fields.DateTime(Required = False)
|
||||
etd_berth_fixed = fields.Bool(Required = False)
|
||||
lock_time = fields.DateTime(Required = False)
|
||||
lock_time_fixed = fields.Bool(Required = False)
|
||||
zone_entry = fields.DateTime(Required = False)
|
||||
zone_entry_fixed = fields.Bool(Required = False)
|
||||
operations_start = fields.DateTime(Required = False)
|
||||
operations_end = fields.DateTime(Required = False)
|
||||
remarks = fields.String(Required = False)
|
||||
participant_id = fields.Int(Required = True)
|
||||
shipcall_id = fields.Int(Required = True)
|
||||
created = fields.DateTime(Required = False)
|
||||
modified = fields.DateTime(Required = False)
|
||||
|
||||
# deserialize PUT object target
|
||||
|
||||
class UserSchema(Schema):
|
||||
def __init__(self):
|
||||
super().__init__(unknown=None)
|
||||
pass
|
||||
id = fields.Int(required=True)
|
||||
first_name = fields.Str(required=False)
|
||||
last_name = fields.Str(required=False)
|
||||
user_phone = fields.Str(required=False)
|
||||
old_password = fields.Str(required=False)
|
||||
new_password = fields.Str(required=False)
|
||||
|
||||
@dataclass
|
||||
class Times:
|
||||
|
||||
id: int
|
||||
start_planned: datetime
|
||||
end_planned: datetime
|
||||
duration_planned: int
|
||||
start_actual: datetime
|
||||
end_actual: datetime
|
||||
duration_actual: int
|
||||
eta_berth: datetime
|
||||
eta_berth_fixed: bool
|
||||
etd_berth: datetime
|
||||
etd_berth_fixed: bool
|
||||
lock_time: datetime
|
||||
lock_time_fixed: bool
|
||||
zone_entry: datetime
|
||||
zone_entry_fixed: bool
|
||||
operations_start: datetime
|
||||
operations_end: datetime
|
||||
remarks: str
|
||||
participant_id: int
|
||||
shipcall_id: int
|
||||
created: datetime
|
||||
@ -158,6 +191,8 @@ class User:
|
||||
user_phone: str
|
||||
password_hash: str
|
||||
api_key: str
|
||||
created: datetime
|
||||
modified: datetime
|
||||
|
||||
@dataclass
|
||||
class Ship(Schema):
|
||||
@ -168,8 +203,12 @@ class Ship(Schema):
|
||||
participant_id: int
|
||||
length: float
|
||||
width: float
|
||||
is_tug: bool
|
||||
bollard_pull: int
|
||||
eni: str
|
||||
created: datetime
|
||||
modified: datetime
|
||||
deleted: bool
|
||||
|
||||
class TimesId(Schema):
|
||||
pass
|
||||
|
||||
Loading…
Reference in New Issue
Block a user