Esempio n. 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);
                }
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }