示例#1
0
 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;
 }
示例#2
0
 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;
 }