private void SaveData(bool confirmSave) { try { Auth_Settings authentication = this.m_pVirtualServer.SystemSettings.Authentication; authentication.AuthenticationType = this.m_pAuthenticationType.SelectedIndex + ServerAuthenticationType_enum.Windows; authentication.WinDomain = this.m_pDomainName.Text; authentication.LdapServer = this.m_pLdapServer.Text; authentication.LdapDn = this.m_pLdapDN.Text; if (this.m_pVirtualServer.SystemSettings.HasChanges && (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)) { this.m_pVirtualServer.SystemSettings.Commit(); } } catch (Exception x) { ErrorForm errorForm = new ErrorForm(x, new StackTrace()); errorForm.ShowDialog(this); } }
private void LoadData() { try { Auth_Settings authentication = this.m_pVirtualServer.SystemSettings.Authentication; this.m_pAuthenticationType.SelectedIndex = Convert.ToInt32(authentication.AuthenticationType) - 1; this.m_pDomainName.Text = authentication.WinDomain; this.m_pLdapServer.Text = authentication.LdapServer; this.m_pLdapDN.Text = authentication.LdapDn; if (this.m_pLdapDN.Text == "") { this.m_pLdapDN.Text = "CN=%user,DC=domain,DC=com"; } } catch (Exception x) { ErrorForm errorForm = new ErrorForm(x, new StackTrace()); errorForm.ShowDialog(this); } }
/// <summary> /// Loads data to UI. /// </summary> private void LoadData() { try{ Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication; m_pAuthenticationType.SelectedIndex = Convert.ToInt32(settings.AuthenticationType) - 1; m_pDomainName.Text = settings.WinDomain; m_pLdapServer.Text = settings.LdapServer; m_pLdapDN.Text = settings.LdapDn; if (m_pLdapDN.Text == "") { m_pLdapDN.Text = "CN=%user,DC=domain,DC=com"; } } catch (Exception x) { wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace()); frm.ShowDialog(this); } }
/// <summary> /// Saves data. /// </summary> /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param> private void SaveData(bool confirmSave) { try{ Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication; settings.AuthenticationType = (ServerAuthenticationType_enum)(m_pAuthenticationType.SelectedIndex + 1); settings.WinDomain = m_pDomainName.Text; settings.LdapServer = m_pLdapServer.Text; settings.LdapDn = m_pLdapDN.Text; if (m_pVirtualServer.SystemSettings.HasChanges) { if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { m_pVirtualServer.SystemSettings.Commit(); } } } catch (Exception x) { wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace()); frm.ShowDialog(this); } }