示例#1
0
        public void GetField(uint handle)
        {
            object szValue = new object();

            if ((int)handle == 0)
            {
                return;
            }
            this.m_bIsSet = false;
            switch (this.eDataType)
            {
            case CPostItem.DataType.STRING:
                this.GetLink().TableGET_RecordField_ValueString(handle, this.sLinkName, "", ref szValue);
                this.sValue   = szValue.ToString();
                this.sValue   = StringManip.RemInvalidChar(this.sValue);
                this.m_bIsSet = true;
                break;

            case CPostItem.DataType.LONG:
                this.nValue   = this.GetLink().TableGET_RecordField_ValueI32(handle, this.sLinkName);
                this.m_bIsSet = true;
                break;

            case CPostItem.DataType.DOUBLE:
                this.dValue   = this.GetLink().TableGET_RecordField_ValueDOUBLE(handle, this.sLinkName);
                this.m_bIsSet = true;
                break;

            case CPostItem.DataType.BOOL:
                this.bValue   = this.GetLink().TableGET_RecordField_ValueBOOL(handle, this.sLinkName) != 0;
                this.m_bIsSet = true;
                break;
            }
        }
示例#2
0
        public void AddRepeatField(uint handle, int nRepeat)
        {
            if (!this.m_bIsSet || (int)handle == 0)
            {
                return;
            }
            switch (this.eDataType)
            {
            case CPostItem.DataType.RepeatSTRING:
                this.sValue = StringManip.RemInvalidChar(this.sValue);
                this.GetLink().TablePOST_AddRecurringField_ValueString(handle, this.sLinkName, nRepeat, this.sValue);
                break;

            case CPostItem.DataType.RepeatLONG:
                this.GetLink().TablePOST_AddRecurringField_ValueI32(handle, this.sLinkName, nRepeat, this.nValue);
                break;

            case CPostItem.DataType.RepeatDOUBLE:
                this.GetLink().TablePOST_AddRecurringField_ValueDOUBLE(handle, this.sLinkName, nRepeat, this.dValue);
                break;

            case CPostItem.DataType.RepeatBOOL:
                this.GetLink().TablePOST_AddRecurringField_ValueBOOL(handle, this.sLinkName, nRepeat, this.bValue ? 1 : 0);
                break;
            }
            this.Clear();
        }