This repository has been archived on 2025-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
BreCal/src/BreCalClient/ShipcallControl.xaml.cs

100 lines
2.6 KiB
C#

// Copyright (c) 2023 schick Informatik
// Description: Show general shipcall info
//
using System;
using System.Windows;
using System.Windows.Controls;
namespace BreCalClient
{
/// <summary>
/// Interaction logic for ShipcallControl.xaml
/// </summary>
public partial class ShipcallControl : UserControl
{
#region Construction
public ShipcallControl()
{
InitializeComponent();
}
#endregion
#region events
public event Action<ShipcallControl>? EditRequested;
public event Action<ShipcallControl>? TimesRequested;
public event Action<ShipcallControl>? OpenExtraRequested;
#endregion
#region Properties
/// <summary>
/// this is our datasource
/// </summary>
public ShipcallControlModel? ShipcallControlModel { get; set; }
#endregion
#region event handler
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
this.DataContext = this.ShipcallControlModel;
if (this.ShipcallControlModel == null) return;
this.labelAgent.Content = this.ShipcallControlModel.AssignedParticipants.ContainsKey(8) ? this.ShipcallControlModel.AssignedParticipants[8].Name : string.Empty;
this.labelMooring.Content = this.ShipcallControlModel.AssignedParticipants.ContainsKey(16) ? this.ShipcallControlModel.AssignedParticipants[16].Name : string.Empty;
}
private void buttonListTimes_Click(object sender, RoutedEventArgs e)
{
if(this.TimesRequested != null)
{
this.TimesRequested(this);
}
}
private void buttonEditShipcall_Click(object sender, RoutedEventArgs e)
{
if (this.EditRequested != null)
{
this.EditRequested(this);
}
}
private void buttonOpenDropDown_Click(object sender, RoutedEventArgs e)
{
if(this.OpenExtraRequested != null)
{
this.OpenExtraRequested(this);
}
}
#endregion
}
}
/*
* Description("not assigned")]
NONE = 0,
[Description("BSMD")]
BSMD = 1,
[Description("Terminal")]
TERMINAL = 2,
[Description("Lotsen")]
PILOT = 4,
[Description("Agentur")]
AGENCY = 8,
[Description("Festmacher")]
MOORING = 16,
[Description("Hafenamt")]
PORT_ADMINISTRATION = 32,
[Description("Schlepper")]
TUG = 64,*/