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); } } }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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)); }
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); }
public void Logout() { int Status = PVCSToolKit.TrkProjectLogout(this.TrackerHandle); this.Helper.CheckStatus("Unable to logout.", Status); int Handle = this.TrackerHandle; PVCSToolKit.TrkHandleFree(ref Handle); }
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); }
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))); }
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); }
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)); }
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); }
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); }
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); }
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()); }
public void ReleaseRecordHandle(int recordHandle) { PVCSToolKit.TrkRecordHandleFree(ref recordHandle); }
public void CancelTransaction(int recordHandle) { PVCSToolKit.TrkRecordCancelTransaction(recordHandle); }
public void ReleaseNoteHandle(int noteHandle) { PVCSToolKit.TrkNoteHandleFree(ref noteHandle); }
public void InitalizeNoteList(int noteHandle) { int Status = PVCSToolKit.TrkInitNoteList(noteHandle); this.Helper.CheckStatus("Unable to initalize note list.", Status); }
public void CommitRecord(int transactionID, int recordHandle) { int Status = PVCSToolKit.TrkUpdateRecordCommit(recordHandle, ref transactionID); this.Helper.CheckStatus("Unable to commit record.", Status); }
public void BeginUpdate(int recordHandle) { int Status = PVCSToolKit.TrkUpdateRecordBegin(recordHandle); this.Helper.CheckStatus("Unable to begin record update.", Status); }
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); }
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); }
public void NewRecordBegin(int recordHandle, int recordType) { int Status = PVCSToolKit.TrkNewRecordBegin(recordHandle, recordType); this.Helper.CheckStatus("Unable to submission of a new record.", Status); }
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); }