Пример #1
0
 private void bnBuildSched_Click(CommandBarButton Ctrl, ref bool CancelDefault)
 {
     try
     {
         if (!loggedIn)
         {
             psc = psc = new ProjectServerConnection("brian", "brian", 1, "dan", 8080);                    //rtc.Username, rtc.Password, 1, rtc.IPAddress, rtc.Port);
             psc.login();
             loggedIn = true;
         }
         BuildSchedule buildSchedule = new BuildSchedule(projectApp, psc);
         buildSchedule.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
 private void bnOpenFromRoundTable_Click(CommandBarButton Ctrl, ref bool CancelDefault)
 {
     // TODO: Add progress bar, etc.
     try
     {
         ProjectServerConnection psc =
             new ProjectServerConnection("brian", "brian", 1, "localhost", 8080);
         psc.login();
         DlgOpenFromRoundTable dlgOpenFrom = new DlgOpenFromRoundTable(this, psc);
         dlgOpenFrom.Show();
     }
     catch (Exception e)
     {
         MessageBox.Show("Unable to connect and authenticate with RoundTable.",
                         "RoundTable Connection Error",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
Пример #3
0
 public void Setup()
 {
     adminPsc = new ProjectServerConnection("administrator", "dommoni", 1, "localhost", 8080);
     adminPsc.login();
 }
Пример #4
0
        //---------------------------------------------------------------------
        // Methods
        //

        public void Connect()
        {
            serverConnection.login();
            connected = true;
        }
Пример #5
0
        //
        // Event Handlers...
        //

        private void bnSendToRoundTable_Click(CommandBarButton Ctrl, ref bool CancelDefault)
        {
            try
            {
                ConnectionSettings      cs  = ConnectionSettings.LoadSettings();
                ProjectServerConnection psc =
                    new ProjectServerConnection(cs.Username, cs.Password, 1, cs.IPAddr, cs.Port);
                psc.login();

                DlgSendToRoundTable dSendToRoundTable =
                    new DlgSendToRoundTable(psc, ref wordApp);
                dSendToRoundTable.Show();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(Utils.MSG_CONNECTION_ERROR, Utils.MSG_CONNECTION_ERROR_DLGTITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            /*Word.Document doc = wordApp.ActiveDocument;
             * if (!doc.Saved)
             * {
             *      // Prompt for save
             *      DialogResult dr;
             *      dr = MessageBox.Show("This document has not been saved. Would you like to save first?",
             *              "Un-Saved Document",
             *              MessageBoxButtons.YesNoCancel,
             *              MessageBoxIcon.Question);
             *
             *      if (dr == DialogResult.Yes)
             *      {
             *              bool docSaved = false;
             *              try
             *              {
             *                      doc.Save();
             *                      docSaved = true;
             *              }
             *              catch(System.Exception ex)
             *              {
             *                      docSaved = false;
             *              }
             *      }
             *      else if (dr == DialogResult.No)
             *      {
             *              return;
             *      }
             *      else if (dr == DialogResult.Cancel)
             *      {
             *              return;
             *      }
             * }
             *
             * if (doc.Saved)
             * {
             *      try
             *      {
             *              object missing = Type.Missing;
             *              string tmpPath = doc.Path + "\\" + doc.Name;
             *              doc.Close(ref missing, ref missing, ref missing);
             *              object filepath = Path.GetFullPath(tmpPath);
             *              FileStream fs = new FileStream((string)filepath, FileMode.Open, FileAccess.Read);
             *              BinaryReader br = new BinaryReader(fs);
             *              byte[] bDocument = br.ReadBytes((int)fs.Length);
             *
             *              br.Close();
             *
             *              doc = wordApp.Documents.Open(ref filepath,
             *                      ref missing, ref missing, ref missing,
             *                      ref missing, ref missing, ref missing,
             *                      ref missing, ref missing, ref missing,
             *                      ref missing, ref missing, ref missing,
             *                      ref missing, ref missing, ref missing);
             *
             *              if (doc != null)
             *              {
             *                      // Create the RoundTable document
             *                      ProjectServerConnection psc = new ProjectServerConnection("brian", "brian", 1, "localhost", 8080);
             *                      psc.login();
             *
             *                      RoundTable.Document rtDoc = new RoundTable.Document();
             *                      rtDoc.document = bDocument;
             *                      rtDoc.name = doc.Name;
             *                      rtDoc.documentType = RoundTable.DocumentType.MSOFFICE_WORD;
             *                      rtDoc.description = "none for now";
             *                      rtDoc.filename = doc.Name;
             *                      rtDoc.ownerId = psc.Account.id;
             *                      rtDoc.projectId = 1;
             *
             *                      // TODO: Need to be sure to always set the current project here!
             *                      RoundTable.Project p = psc.ProjectManager.getProject(1);
             *                      psc.CurrentProject = p;
             *
             *                      psc.DocumentManager.addDocument(rtDoc);
             *              }
             *      }
             *      catch(System.Exception ex)
             *      {
             *              MessageBox.Show(ex.Message);
             *      }
             * }*/
        }
Пример #6
0
 public void Setup()
 {
     adminPsc = new ProjectServerConnection(testUsername, testPassword, testSessionType, testHost, testPort);
     adminPsc.login();
 }