Example #1
0
        public object GetFieldValue(int scrId, string fieldName)
        {
            int RecordHandle = 0;

            try
            {
                int Status = 0;
                RecordHandle = this.GetSCRRecordHandle(scrId, 1);

                int FieldType = this.GetFieldType(fieldName);
                if ((int)ServerHelper._TrkFieldType.TRK_FIELD_TYPE_NUMBER == FieldType)
                {
                    int IntegerValue = 0;
                    Status = PVCSToolKit.TrkGetNumericFieldValue(RecordHandle, ref fieldName, ref IntegerValue);
                    this.Helper.CheckStatus("Unable to retrieve field value.", Status);
                    return(IntegerValue);
                }
                else // ServerHelper._TrkFieldType.TRK_FIELD_TYPE_STRING or if other type, then convert to string
                {
                    string StringValue = this.Helper.MakeBigEmptyString(ServerHelper.MAX_BUFFER_LENGTH);
                    Status = PVCSToolKit.TrkGetStringFieldValue(RecordHandle, ref fieldName, StringValue.Length, ref StringValue);
                    this.Helper.CheckStatus("Unable to retrieve field value.", Status);
                    return(this.Helper.CleanupString(StringValue));
                }
            }
            finally
            {
                if (0 != RecordHandle)
                {
                    this.ReleaseRecordHandle(RecordHandle);
                }
            }
        }
Example #2
0
        public int GetFieldType(string fieldName)
        {
            int FieldType = 0;
            int Status    = PVCSToolKit.TrkGetFieldType(this.TrackerHandle, ref fieldName, 1, ref FieldType);

            this.Helper.CheckStatus("Unable to retrieve field type: " + fieldName, Status);
            return(FieldType);
        }
Example #3
0
        public int GetFieldTransactionId(string fieldName, int recordHandle)
        {
            int TransactionId = 0;
            int Status        = PVCSToolKit.TrkGetFieldTransactionID(recordHandle, ref fieldName, ref TransactionId);

            this.Helper.CheckStatus("Unable to get transaction id.", Status);
            return(TransactionId);
        }
Example #4
0
        public int GetNoteHandle(int recordHandle)
        {
            int NoteHandle = 0;
            int Status     = PVCSToolKit.TrkNoteHandleAlloc(recordHandle, ref NoteHandle);

            this.Helper.CheckStatus("Unable to get Note Handle.", Status);
            return(NoteHandle);
        }
Example #5
0
        public void InitalizeRecordList(int recordHandle, string queryName)
        {
            int TransactionId    = 0;
            int NewTransactionId = 0;
            int Status           = PVCSToolKit.TrkQueryInitRecordList(recordHandle, ref queryName, TransactionId, ref NewTransactionId);

            this.Helper.CheckStatus("Unable to initalize query record list. Query=" + queryName, Status);
        }
Example #6
0
        public int GetDescriptionLength(int recordHandle)
        {
            int Remainder = 0;
            int Status    = PVCSToolKit.TrkGetDescriptionDataLength(recordHandle, ref Remainder);

            this.Helper.CheckStatus("Unable to get description length.", Status);
            return(Remainder);
        }
Example #7
0
        public int GetNumericFieldValue(int recordHandle, string fieldName)
        {
            int newValue = 0;
            int Status   = PVCSToolKit.TrkGetNumericFieldValue(recordHandle, ref fieldName, ref newValue);

            this.Helper.CheckStatus("Unable to retrieve numeric field value: " + fieldName, Status);
            return(newValue);
        }
Example #8
0
        public int GetSCRRecordHandle(int scrId, [Optional] int recordType /* = 1 */)
        {
            int RecordHandle = this.AllocateRecordHandle();
            int Status       = PVCSToolKit.TrkGetSingleRecord(RecordHandle, scrId, recordType);

            this.Helper.CheckStatus("Unable to retrieve SCR handle.", Status);
            return(RecordHandle);
        }
Example #9
0
        public int AllocateRecordHandle()
        {
            int RecordHandle = 0;
            int Status       = PVCSToolKit.TrkRecordHandleAlloc(this.TrackerHandle, ref RecordHandle);

            this.Helper.CheckStatus("Unable to retrieve SCR handle.", Status);
            return(RecordHandle);
        }
Example #10
0
        public string GetNoteCreateTime(int noteHandle)
        {
            int NoteCreationTime = 0;
            int Status           = PVCSToolKit.TrkGetNoteCreateTime(noteHandle, ref NoteCreationTime);

            this.Helper.CheckStatus("Unable to get note creation time.", Status);

            return(this.Helper.ConvertDateToString(NoteCreationTime));
        }
Example #11
0
        public string GetNoteAuthor(int noteHandle)
        {
            string NoteText = this.Helper.MakeBigEmptyString(ServerHelper.MAX_BUFFER_LENGTH);
            int    Status   = PVCSToolKit.TrkGetNoteAuthor(noteHandle, NoteText.Length, ref NoteText);

            this.Helper.CheckStatus("Unable to get note author.", Status);
            NoteText = this.Helper.CleanupString(NoteText);
            return(NoteText);
        }
Example #12
0
        public void Logout()
        {
            int Status = PVCSToolKit.TrkProjectLogout(this.TrackerHandle);

            this.Helper.CheckStatus("Unable to logout.", Status);
            int Handle = this.TrackerHandle;

            PVCSToolKit.TrkHandleFree(ref Handle);
        }
Example #13
0
        public int GetSCRID(int recordHandle)
        {
            int    num2   = 0;
            string text1  = "Id";
            int    Status = PVCSToolKit.TrkGetNumericFieldValue(recordHandle, ref text1, ref num2);

            this.Helper.CheckStatus("Unable to retrieve field value.", Status);
            return(num2);
        }
Example #14
0
        public bool GetNextScrId(int recordHandle)
        {
            int Status = PVCSToolKit.TrkGetNextRecord(recordHandle);

            if ((int)ServerHelper._TrkError.TRK_E_END_OF_LIST != Status)
            {
                this.Helper.CheckStatus("Unable to get next SCR handle.", Status);
            }
            return(!(((int)ServerHelper._TrkError.TRK_E_END_OF_LIST == Status)));
        }
Example #15
0
        public void Login(string userName, string password, string projectName, string dbmsUserName, string dbmsPassword, string dbmsServer, string dbmsType, int dbmsLoginMode)
        {
            int Handle = 0;
            int Status = PVCSToolKit.TrkHandleAlloc(ServerHelper.TRK_VERSION_ID, ref Handle);

            this.Helper.CheckStatus("Failed to allocate tracker handle.", Status);
            this.TrackerHandle = Handle;
            Status             = PVCSToolKit.TrkProjectLogin(this.TrackerHandle, ref userName, ref password, ref projectName, ref dbmsType, ref dbmsServer, ref dbmsUserName, ref dbmsPassword, dbmsLoginMode);
            this.Helper.CheckStatus("Unable to login.", Status);
        }
Example #16
0
        public bool GetNextNote(int noteHandle)
        {
            int Status = PVCSToolKit.TrkGetNextNote(noteHandle);

            if ((int)ServerHelper._TrkError.TRK_E_END_OF_LIST != Status)
            {
                this.Helper.CheckStatus("Unable to get next note.", Status);
            }
            return(!((int)ServerHelper._TrkError.TRK_E_END_OF_LIST == Status));
        }
Example #17
0
        public int GetNoteTransactionId(int noteHandle)
        {
            int TransactionId = 0;
            int Status        = PVCSToolKit.TrkGetNoteTransactionID(noteHandle, ref TransactionId);

            if ((int)ServerHelper._TrkError.TRK_E_NO_CURRENT_NOTE != Status)
            {
                this.Helper.CheckStatus("Unable to get Transaction ID.", Status);
            }
            return(TransactionId);
        }
Example #18
0
        public string GetDescriptionPart(ref int remainder, int recordHandle)
        {
            string DescriptionPart = this.Helper.MakeBigEmptyString(ServerHelper.MAX_BUFFER_LENGTH);
            int    Status          = PVCSToolKit.TrkGetDescriptionData(recordHandle, DescriptionPart.Length, ref DescriptionPart, ref remainder);

            if (Status != (int)ServerHelper._TrkError.TRK_E_DATA_TRUNCATED)
            {
                this.Helper.CheckStatus("Unable to retrieve part of the description.", Status);
            }
            DescriptionPart = this.Helper.CleanupString(DescriptionPart);
            return(DescriptionPart);
        }
Example #19
0
        public void AddNote(string noteTitle, string noteText, int noteHandle)
        {
            int RecordSize = 0;
            int Status     = PVCSToolKit.TrkAddNewNote(noteHandle);

            this.Helper.CheckStatus("Unable to add new note.", Status);

            Status = PVCSToolKit.TrkSetNoteTitle(noteHandle, ref noteTitle);
            this.Helper.CheckStatus("Unable to set note title.", Status);

            Status = PVCSToolKit.TrkSetNoteData(noteHandle, noteText.Length, ref noteText, RecordSize);
            this.Helper.CheckStatus("Unable to set note text.", Status);
        }
Example #20
0
        public string GetNoteText(int noteHandle)
        {
            int           Remainder       = 1;
            StringBuilder NoteTextBuilder = new StringBuilder();

            while (Remainder != 0)
            {
                string NoteTextPart = this.Helper.MakeBigEmptyString(ServerHelper.MAX_BUFFER_LENGTH);
                int    Status       = PVCSToolKit.TrkGetNoteData(noteHandle, NoteTextPart.Length, ref NoteTextPart, ref Remainder);
                if (Remainder == 0)
                {
                    break;
                }
                if ((int)ServerHelper._TrkError.TRK_E_DATA_TRUNCATED != Status)
                {
                    this.Helper.CheckStatus("Unable to retrieve part of the note text.", Status);
                }
                NoteTextBuilder.Append(this.Helper.CleanupString(NoteTextPart));
            }
            return(NoteTextBuilder.ToString());
        }
Example #21
0
 public void ReleaseRecordHandle(int recordHandle)
 {
     PVCSToolKit.TrkRecordHandleFree(ref recordHandle);
 }
Example #22
0
 public void CancelTransaction(int recordHandle)
 {
     PVCSToolKit.TrkRecordCancelTransaction(recordHandle);
 }
Example #23
0
 public void ReleaseNoteHandle(int noteHandle)
 {
     PVCSToolKit.TrkNoteHandleFree(ref noteHandle);
 }
Example #24
0
        public void InitalizeNoteList(int noteHandle)
        {
            int Status = PVCSToolKit.TrkInitNoteList(noteHandle);

            this.Helper.CheckStatus("Unable to initalize note list.", Status);
        }
Example #25
0
        public void CommitRecord(int transactionID, int recordHandle)
        {
            int Status = PVCSToolKit.TrkUpdateRecordCommit(recordHandle, ref transactionID);

            this.Helper.CheckStatus("Unable to commit record.", Status);
        }
Example #26
0
        public void BeginUpdate(int recordHandle)
        {
            int Status = PVCSToolKit.TrkUpdateRecordBegin(recordHandle);

            this.Helper.CheckStatus("Unable to begin record update.", Status);
        }
Example #27
0
        public void SaveNumericFieldValue(string fieldName, int newValue, int recordHandle)
        {
            int Status = PVCSToolKit.TrkSetNumericFieldValue(recordHandle, ref fieldName, newValue);

            this.Helper.CheckStatus("Unable to save field value.", Status);
        }
Example #28
0
        public void NewRecordCommit(int recordHandle, ref int pNewTransactionID)
        {
            int Status = PVCSToolKit.TrkNewRecordCommit(recordHandle, ref pNewTransactionID);

            this.Helper.CheckStatus("Unable to submit a new record.", Status);
        }
Example #29
0
        public void NewRecordBegin(int recordHandle, int recordType)
        {
            int Status = PVCSToolKit.TrkNewRecordBegin(recordHandle, recordType);

            this.Helper.CheckStatus("Unable to submission of a new record.", Status);
        }
Example #30
0
        public void SaveStringFieldValue(string fieldName, string newValue, int recordHandle)
        {
            int Status = PVCSToolKit.TrkSetStringFieldValue(recordHandle, ref fieldName, ref newValue);

            this.Helper.CheckStatus("Unable to save field value: fieldName=" + fieldName + " newValue=" + newValue, Status);
        }