public bool loginToDomain(Domain domain) { bool result = false; if (domain != null) { Connecting connecting = new Connecting(this.ifWebService, simiasWebService, simiasManager, domain.DomainInfo); if (connecting.ShowDialog() == DialogResult.OK) { result = true; } if (!result) { ServerInfo serverInfo = new ServerInfo(this.ifWebService, simiasManager, domain.DomainInfo, connecting.Password); serverInfo.ShowDialog(); result = serverInfo.DomainInfo.Authenticated; serverInfo.Dispose(); } connecting.Dispose(); } if (result) { domain.DomainInfo.Authenticated = true; FormsTrayApp.globalProp().updateifListViewDomainStatus(domain.DomainInfo.ID, true); FormsTrayApp.globalProp().AddDomainToUIList(domain.DomainInfo); FormsTrayApp.globalProp().UpdateiFolderStatus(domain.DomainInfo.Authenticated, domain.DomainInfo.ID); } return result; }
private bool login(int itemIndex) { bool result = false; ListViewItem lvi = accounts.Items[itemIndex]; Domain domain = (Domain)lvi.Tag; if (domain != null) { Connecting connecting = new Connecting(this.ifWebService, simiasWebService, simiasManager, domain.DomainInfo); if (connecting.ShowDialog() == DialogResult.OK) { result = true; } if (!result) { ServerInfo serverInfo = new ServerInfo(this.ifWebService, simiasManager, domain.DomainInfo, connecting.Password); serverInfo.ShowDialog(); result = serverInfo.DomainInfo.Authenticated; serverInfo.Dispose(); } connecting.Dispose(); } if (result) { domain.DomainInfo.Authenticated = true; FormsTrayApp.globalProp().updateifListViewDomainStatus(domain.DomainInfo.ID, true); FormsTrayApp.globalProp().AddDomainToUIList(domain.DomainInfo); lvi.Tag = domain; } return result; }