コード例 #1
0
ファイル: SettingsView.xaml.cs プロジェクト: molser/UFO
 public SettingsView(Settings settings)
 {
     InitializeComponent();
     this.DataContext = this;
     this.settings    = settings;
     this.dbWorker    = new DbWorker();
     this.dbWorker.CheckDbConnectionComplitted += onCheckDbConnectionComplitted;
     loadMainSettings();
     loadKaskadSettings();
     this.pbPassword.Password = "******";
     this.KaskadSqlPasswordPasswordBox.Password         = "******";
     this.pbPassword.PasswordChanged                   += PbPassword_PasswordChanged;
     this.KaskadSqlPasswordPasswordBox.PasswordChanged += KaskadSqlPasswordPasswordBox_PasswordChanged;
     this.tbDatabaseName.TextChanged                   += settingChanged;
     this.tbSqlServer.TextChanged += settingChanged;
     this.tbLogin.TextChanged     += settingChanged;
     this.KaskadSqlDatabaseNameTextBox.TextChanged += settingChanged;
     this.KaskadSqlServerTextBox.TextChanged       += settingChanged;
     this.KaskadSqlLoginTextBox.TextChanged        += settingChanged;
     this.IsKaskadDbUsedCheckBox.Unchecked         += IsKaskadDbUsedCheckBox_Changed;
     this.IsKaskadDbUsedCheckBox.Checked           += IsKaskadDbUsedCheckBox_Changed;
     //this.tbIndex.TextChanged += settingChanged;
     WindowsLog.LogOpenSettingsWindow();
     this.btSave.IsEnabled = false;
     //this.isMainWindowShowed = isMainWindowShowed;
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: molser/UFO
 public MainWindow(Settings settings, DbWorker dbWorker)
 {
     InitializeComponent();
     this.settings = settings;
     this.dbWorker = dbWorker;
     loadApplicationTheme();
     date_end.SelectedDate   = DateTime.Today;
     date_start.SelectedDate = DateTime.Today.AddDays(-1);
     date_end.DisplayDate    = DateTime.Today;
     date_start.DisplayDate  = DateTime.Today.AddDays(-1);
     WindowsLog.LogAppStart();
 }
コード例 #3
0
ファイル: PhotoFromDbViewModel.cs プロジェクト: molser/UFO
 public PhotoFromDbViewModel(PhotoFromDbView view, PhotoSearchServiceClient proxy)
 {
     this.view     = view;
     this.proxy    = proxy;
     this.dbWorker = new DbWorker();
     //this.birthday = new DateTime();
     this.operationDateStart = DateTime.Now.Date;
     this.operationDateEnd   = this.operationDateStart.Add(new TimeSpan(23, 59, 59));
     //this.personNames = getPersonNamesList();
     //this.personNames.Add("Иванов Петр Петрович");
     //this.personNames.Add("Сидоров Иван Евгеньевич");
     //this.personNames.Add("Петров Петр Петрович");
 }
コード例 #4
0
ファイル: PersonView.xaml.cs プロジェクト: molser/UFO
        public PersonView(Person currentPerson)
        {
            InitializeComponent();
            //this.settings = settings;
            this.dbWorker = new DbWorker();
            // Вешаем обработчик на событие перед закрытием окна.
            Closing += new CancelEventHandler(Window_Closing);
            // Восстанавливаем позицию на экране.
            Left = Properties.Settings.Default.PersonWindowPosition.Left;
            Top  = Properties.Settings.Default.PersonWindowPosition.Top;
            // Востанавливаем размеры окна.
            Width  = Properties.Settings.Default.PersonWindowPosition.Width;
            Height = Properties.Settings.Default.PersonWindowPosition.Height;

            this.currentPerson = currentPerson;
            this.loadData();
        }
コード例 #5
0
ファイル: NationalitiesViewModel.cs プロジェクト: molser/UFO
        //private IDataAccessService das = null;

        #endregion


        #region Constructor

        public NationalitiesViewModel(ListView view,
                                      //List<AccessPoint> items,
                                      AppObjectBase[] selectedItems)
        //IDataAccessService das)
            : base(view)
        {
            this.view       = view;
            base.Title      = "Гражданство";
            this.dbWorker   = new DbWorker();
            this.items      = this.getItems();
            this.itemsArray = this.items.ToArray();
            base.ItemProperties.Add("IsChecked");
            base.ItemProperties.Add("Name");
            base.ItemProperties.Add("Id");

            base.CheckItems(selectedItems);
            base.SubscribeOnItemChanged();
        }
コード例 #6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            //this.mainWindow = new MainWindow(settings);
            //mainWindow.Show();
            this.settings = new Settings();
            this.settings.Load();

            if (!settings.IsCorrect)
            {
                settings.SetMainDefaults();
                settings.Save();
            }

            settings.SetGlobal();
            this.dbWorker   = new DbWorker();
            this.mainWindow = new MainWindow(this.settings, this.dbWorker);
            this.dbWorker.CheckDbConnectionComplitted += onCheckDbConnectionComplitted;
            dbWorker.CheckDBConnectionVisualAsync(Settings.GlobalMainDbConnectionString, false);
        }