68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
// Copyright (c) 2017- schick Informatik
|
|
// Description: Dialog to confirm values during excel import (e.g. CREW/PAS)
|
|
//
|
|
|
|
using ENI2.Controls;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
|
|
namespace ENI2.EditControls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for FixImportDialog.xaml
|
|
/// </summary>
|
|
public partial class FixImportDialog : EditWindowBase
|
|
{
|
|
public FixImportDialog()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public bool LocodeMode
|
|
{
|
|
get { return this.locodeControl.Visibility == Visibility.Visible; }
|
|
set
|
|
{
|
|
this.locodeControl.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
|
this.comboBoxValues.Visibility = value ? Visibility.Hidden : Visibility.Visible;
|
|
}
|
|
}
|
|
|
|
public string SelectedValue
|
|
{
|
|
get
|
|
{
|
|
if (LocodeMode) return this.locodeControl.LocodeValue;
|
|
return this.comboBoxValues.SelectedValue as string;
|
|
}
|
|
}
|
|
|
|
public string Value
|
|
{
|
|
get { return this.textBlockValue.Text; }
|
|
set { this.textBlockValue.Text = value.Trim(); }
|
|
}
|
|
|
|
public string ValueType
|
|
{
|
|
get { return this.textBlockType.Text; }
|
|
set { this.textBlockType.Text = value; }
|
|
}
|
|
|
|
public Dictionary<string, string> SelectionValues { get; set; }
|
|
|
|
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
if (LocodeMode)
|
|
{
|
|
this.locodeControl.Focus();
|
|
}
|
|
else
|
|
{
|
|
this.comboBoxValues.ItemsSource = this.SelectionValues;
|
|
this.comboBoxValues.Focus();
|
|
}
|
|
}
|
|
}
|
|
}
|