| | |
| | | using Microsoft.Win32; |
| | | using Panuon.WPF.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.ComponentModel; |
| | | using System.IO; |
| | |
| | | base.OnClosing(e); |
| | | } |
| | | |
| | | public bool ValidateDBAddress(object value, out string err) |
| | | public bool ValidateName(object value, out string err) |
| | | { |
| | | err = null; |
| | | |
| | | var target = Datasource.FirstOrDefault(e => e.Program == value.ToString()); |
| | | if (target != null && target != Data) |
| | | { |
| | | err = this.lang("App.MustBeUnique", LangUtil.Get("Dv.Datasource.Name")); ; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | Data.Program = programInput.Text; |
| | | Data.DBFilePath = dbFilePathInput.Text; |
| | | Data.TableName = tableNameInput.Text; |
| | | Data.Pattern = TbPattern.Text; |
| | | Data.TimeCol = Conditions.FirstOrDefault(c => c.IsTimeCol)?.Key; |
| | | Data.Condition = Conditions; |
| | | } |
| | |
| | | programInput.Text = Data.Program; |
| | | dbFilePathInput.Text = Data.DBFilePath; |
| | | tableNameInput.Text = Data.TableName; |
| | | Conditions = data?.Condition ?? new ObservableCollection<QueryCondition>(); |
| | | TbPattern.Text = Data.Pattern; |
| | | |
| | | if (!string.IsNullOrEmpty(Data.DBFilePath) && File.Exists(Data.DBFilePath)) |
| | | { |
| | |
| | | tableNameInput.SelectedItem = Data.TableName; |
| | | UpdateColumnSource(Data.TableName); |
| | | } |
| | | Conditions = data?.Condition ?? new ObservableCollection<QueryCondition>(); |
| | | |
| | | return this.ShowDialog(); |
| | | } |
| | |
| | | } |
| | | else if (Helper.DataBaseFile != filePath) |
| | | { |
| | | Helper.Close(); |
| | | //Helper.Close(); |
| | | Helper = new SqliteHelper(filePath); |
| | | } |
| | | } |
| | |
| | | private void ComboxSelectionChanged(object sender, SelectionChangedEventArgs e) |
| | | { |
| | | UpdateColumnSource(e.AddedItems[0].ToString()); |
| | | Conditions = new ObservableCollection<QueryCondition>(); |
| | | //Conditions = new ObservableCollection<QueryCondition>(); |
| | | } |
| | | |
| | | private void RadioButton_Click(object sender, System.Windows.RoutedEventArgs e) |