예제 #1
0
 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
 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
 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
        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
        //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);
        }