private void AuthService_LoginCompleted(object sender, LoginCompletedEventArgs e) { if (e.Result.Return) { EppmConnection connect = new EppmConnection(); connect.dbType = dbInsts[dbCmb.SelectedIndex].DatabaseType; connect.sessionCookie = authService.CookieContainer; connect.dbName = dbCmb.Text; this.OnEppmConnected.Invoke(connect); this.Close(); } else { MessageBox.Show(e.Error.Message); dbCmb.Enabled = true; eppmLogin.Enabled = true; eppmPasswd.Enabled = true; eppmConnect.Enabled = true; } }
private void Win_OnEppmConnected(EppmConnection eppmConnection) { this.eppmConnection = eppmConnection; this.eppmConnectBtn.Text = "Отключиться"; this.isEppmConnect = true; this.eppmStatusConnection.Text = String.Format("Подключено к {0}", this.eppmConnection.dbName); using (EPSService epsServ = new EPSService()) { epsServ.Url = String.Format("{0}/p6ws/services/EPSService", Properties.Settings.Default.EppmWsUrl); epsServ.CookieContainer = eppmConnection.sessionCookie; using (ProjectService projServ = new ProjectService()) { projServ.Url = String.Format("{0}/p6ws/services/V1/ProjectService", Properties.Settings.Default.EppmWsUrl); projServ.CookieContainer = eppmConnection.sessionCookie; TreeNode[] treeNodes = _readEPS2Tree(epsServ, null, projServ); if (treeNodes != null) { projectTree.Nodes.AddRange(treeNodes); projectTree.Enabled = true; } } } }
public PpmSync(EppmConnection eppmConnection) { InitializeComponent(); this.eppm = eppmConnection; }