示例#1
0
		private void FormCentralManager_Load(object sender,EventArgs e) {
			if(!GetConfigAndConnect()){
				return;
			}
			Cache.Refresh(InvalidType.Prefs);
			Version storedVersion=new Version(PrefC.GetString(PrefName.ProgramVersion));
			Version currentVersion=Assembly.GetAssembly(typeof(Db)).GetName().Version;
			if(storedVersion.CompareTo(currentVersion)!=0){
				MessageBox.Show(Lan.g(this,"Program version")+": "+currentVersion.ToString()+"\r\n"
					+Lan.g(this,"Database version")+": "+storedVersion.ToString()+"\r\n"
					+Lan.g(this,"Versions must match.  Please manually connect to the database through the main program in order to update the version."));
				Application.Exit();
				return;
			}
			if(PrefC.GetString(PrefName.CentralManagerPassHash)!=""){
				FormCentralPasswordCheck FormCPC=new FormCentralPasswordCheck();
				FormCPC.ShowDialog();
				if(FormCPC.DialogResult!=DialogResult.OK){
					Application.Exit();
					return;
				}
			}
			_listConnectionGroups=ConnectionGroups.GetListt();
			comboConnectionGroups.Items.Clear();
			comboConnectionGroups.Items.Add("All");
			for(int i=0;i<_listConnectionGroups.Count;i++) {
				comboConnectionGroups.Items.Add(_listConnectionGroups[i].Description);
			}
			comboConnectionGroups.SelectedIndex=0;//Select 'All' on load.
			FillGrid();
		}
		private void FormCentralManager_Load(object sender,EventArgs e) {
			IsStartingUp=true;
			if(!GetConfigAndConnect()){
				return;
			}
			Cache.Refresh(InvalidType.Prefs);
			Version storedVersion=new Version(PrefC.GetString(PrefName.ProgramVersion));
			Version currentVersion=Assembly.GetAssembly(typeof(Db)).GetName().Version;
			if(storedVersion.CompareTo(currentVersion)!=0){
				MessageBox.Show("Program version: "+currentVersion.ToString()+"\r\n"
					+"Database version: "+storedVersion.ToString()+"\r\n"
					+"Versions must match.  Please manually connect to the database through the main program in order to update the version.");
				Application.Exit();
				return;
			}
			if(PrefC.GetString(PrefName.CentralManagerPassHash)!=""){
				FormCentralPasswordCheck formC=new FormCentralPasswordCheck();
				formC.ShowDialog();
				if(formC.DialogResult!=DialogResult.OK){
					Application.Exit();
					return;
				}
			}
			FillGrid();
			IsStartingUp=false;
		}
示例#3
0
        private void FormCentralManager_Load(object sender, EventArgs e)
        {
            IsStartingUp = true;
            if (!GetConfigAndConnect())
            {
                return;
            }
            Cache.Refresh(InvalidType.Prefs);
            Version storedVersion  = new Version(PrefC.GetString(PrefName.ProgramVersion));
            Version currentVersion = Assembly.GetAssembly(typeof(Db)).GetName().Version;

            if (storedVersion.CompareTo(currentVersion) != 0)
            {
                MessageBox.Show("Program version: " + currentVersion.ToString() + "\r\n"
                                + "Database version: " + storedVersion.ToString() + "\r\n"
                                + "Versions must match.  Please manually connect to the database through the main program in order to update the version.");
                Application.Exit();
                return;
            }
            if (PrefC.GetString(PrefName.CentralManagerPassHash) != "")
            {
                FormCentralPasswordCheck formC = new FormCentralPasswordCheck();
                formC.ShowDialog();
                if (formC.DialogResult != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }
            FillGrid();
            IsStartingUp = false;
        }