private void readRegistry() { CMSettings cmSettings = ConnectionSettingsManager.GetCMSettings(); CRMSettings crmSettings = ConnectionSettingsManager.GetCRMSettings(); int refreshRate = ServiceSettingsManager.GetRefreshRate(); if (cmSettings != null) { CMUserName.Text = cmSettings.UserName; CMPassword.Password = cmSettings.Password; CMApiKey.Text = cmSettings.ApiKey; } if (crmSettings != null) { CRMUserName.Text = crmSettings.UserName; CRMPassword.Password = crmSettings.Password; CRMDomain.Text = crmSettings.Domain; CRMUrl.Text = crmSettings.Url; if (crmSettings.ProtocolSSH) { CRMProtocol.SelectedIndex = 1; } else { CRMProtocol.SelectedIndex = 0; } } RefreshRate.Text = refreshRate.ToString(); }
private void readRegistry() { CMSettings cmSettings = ConnectionSettingsManager.GetCMSettings(); CRMSettings crmSettings = ConnectionSettingsManager.GetCRMSettings(); if (cmSettings != null) { CMUserName.Text = cmSettings.UserName; CMPassword.Password = cmSettings.Password; CMApiKey.Text = cmSettings.ApiKey; } if (crmSettings != null) { CRMUserName.Text = crmSettings.UserName; CRMPassword.Password = crmSettings.Password; CRMDomain.Text = crmSettings.Domain; CRMUrl.Text = crmSettings.Url; if (crmSettings.ProtocolSSH) { CRMProtocol.SelectedIndex = 1; } else { CRMProtocol.SelectedIndex = 0; } } //RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software", true); //if (rk.OpenSubKey("CM_CRM_Sync") == null) //{ // rk.CreateSubKey("CM_CRM_Sync"); // rk.SetValue("CMUserName", "null"); // rk.SetValue("CMPassword", "null"); // rk.SetValue("CMApiKey", "null"); // rk.SetValue("CRMPassword", "null"); // rk.SetValue("CRMUserName", "null"); // rk.SetValue("CRMDomain", "null"); // rk.SetValue("CRMUrl", "null"); // rk.SetValue("CRMProtocol", "null"); //} //if (!rk.GetValue("CMUserName").ToString().Equals("null")) // CMUserName.Text = rk.GetValue("CMUserName").ToString(); //if (!rk.GetValue("CMPassword").ToString().Equals("null")) // CMPassword.Password = rk.GetValue("CMPassword").ToString(); //if (!rk.GetValue("CMApiKey").ToString().Equals("null")) // CMApiKey.Text = rk.GetValue("CMApiKey").ToString(); //if (!rk.GetValue("CRMPassword").ToString().Equals("null")) // CRMPassword.Password = rk.GetValue("CRMPassword").ToString(); //if (!rk.GetValue("CRMUserName").ToString().Equals("null")) // CRMUserName.Text = rk.GetValue("CRMUserName").ToString(); //if (!rk.GetValue("CRMDomain").ToString().Equals("null")) // CRMDomain.Text = rk.GetValue("CRMDomain").ToString(); //if (!rk.GetValue("CRMUrl").ToString().Equals("null")) // CRMUrl.Text = rk.GetValue("CRMUrl").ToString(); //if (rk.GetValue("CRMProtocol").ToString().Equals("HTTPS")) // CRMProtocol.SelectedIndex = 1; //else // CRMProtocol.SelectedIndex = 0; }
private void InitializeRepository() { cmSettings = ConnectionSettingsManager.GetCMSettings(); cmRepo = new CMRepository(cmSettings); crmSettings = ConnectionSettingsManager.GetCRMSettings(); crmRepo = new CRMRepository(crmSettings); }
//Read from register (instalation path, connection settings) private void Initialization() { cmSettings = ConnectionSettingsManager.GetCMSettings(); crmSettings = ConnectionSettingsManager.GetCRMSettings(); try { cmRepo = new CMRepository(cmSettings); crmRepo = new CRMRepository(crmSettings); } catch (Exception) { EventLogManager.WriteMessage(new Message() { Description = "Connection settings error", Type = "Error", Time = DateTime.Now }, EventType.Error); } }