Exemplo n.º 1
0
 private void connect()
 {
     try
     {
         if (updateManager == null)
         {
             if (cbIntegratedSecurity.Checked)
                 updateManager = new UpdateManager(tbServerName.Text, tbDBName.Text);
             else
                 updateManager = new UpdateManager(tbServerName.Text, tbDBName.Text, tbUserName.Text, tbPassword.Text);
             updateManager.OnMessage += new Baumax.DBUpdater.MessageEventHandler(onDbUpdateMessage);
             updateManager.OnDbUpdateComplete += new UpdateCompleteEventHandler(onDbUpdateComplete);
             updateManager.OnBatchComplete += new UpdateCompleteEventHandler(onDbUpdateBatchComplete);
             updateManager.OnProgressUpdateChanged += new UpdateProgressEventHangler(onDbUpdateProgress);
             updateManager.OnProgressBatchChanged += new UpdateProgressEventHangler(onDbUpdateBatchProgress);
             dbVersion = updateManager.GetDBVersion();
             _ConnectedToServer = string.Format(res.ConnectedToServer, tbServerName.Text, tbDBName.Text, dbVersion.ToString());
             addTextToMemo(_ConnectedToServer);
             ConnectionON = true;
         }
     }
     catch (Exception ex)
     {
         addTextToMemo(ex.Message);
         addTextToMemo(res.ConnectionError);
         ConnectionON = false;
     }
 }
Exemplo n.º 2
0
 private void updateDB()
 {
     try
     {
         Locale locale = (Locale)cbLang.SelectedItem;
         Localization.Instance.ResourcesLoad(locale);
     }
     catch { }
     UpdateManager updateManager = new UpdateManager("SERVER\\BAUMAX", "BauMax_Test");
     updateManager.OnMessage += new Baumax.DBUpdater.MessageEventHandler(onDbUpdateMessage);
     updateManager.OnDbUpdateComplete += new UpdateCompleteEventHandler(onDbUpdateComplete);
     updateManager.OnBatchComplete += new UpdateCompleteEventHandler(onDbUpdateBatchComplete);
     updateManager.OnProgressUpdateChanged += new UpdateProgressEventHangler(onDbUpdateProgress);
     updateManager.OnProgressBatchChanged += new UpdateProgressEventHangler(onDbUpdateBatchProgress);
     memoEdit.Text = "";
     updateManager.Update(new Version("0.0.5"));
 }
Exemplo n.º 3
0
 private void disconnect()
 {
     updateManager = null;
     ConnectionON = false;
     addTextToMemo(res.Disconnected);
 }