예제 #1
0
        private void ButtonTableIdCheck_Click(object sender, RoutedEventArgs e)
        {
            int?idTypeTable = ViewModel.TypeTableId;

            if (idTypeTable.HasValue)
            {
                _typeRepository.GetTypeTable(idTypeTable.Value).Match(
                    None: () => {
                    EllipseTableId.Fill = Brushes.Red;
                    return(Unit());
                },
                    Some: t => {
                    EllipseTableId.Fill   = Brushes.Green;
                    TextBlockTableId.Text = t.Table + "(" + t.Name + ")";
                    return(Unit());
                }
                    );
            }
            else
            {
                EllipseTableId.Fill = Brushes.Green;
            }

            e.Handled = true;
        }