53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using brecal.model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace RoleEditor
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for EditBerthDialog.xaml
|
|
/// </summary>
|
|
public partial class EditBerthDialog : Window
|
|
{
|
|
public EditBerthDialog()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public Berth Berth { get; set; } = new Berth();
|
|
|
|
private void buttonCancel_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.DialogResult = false;
|
|
this.Close();
|
|
}
|
|
|
|
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.Berth.Name = this.textBoxName.Text.Trim();
|
|
this.Berth.Lock = this.checkBoxLock.IsChecked;
|
|
this.Berth.Participant = this.comboBoxParticipants.SelectedItem as Participant;
|
|
if(this.Berth.Participant != null)
|
|
this.Berth.Participant_Id = this.Berth.Participant.Id;
|
|
this.DialogResult = true;
|
|
this.Close();
|
|
}
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
this.DataContext = this.Berth;
|
|
}
|
|
}
|
|
}
|