public override void AddRecord() { if ((int)this.m_hndPOST == 0) { this.m_hndPOST = this.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if (!this.m_NickName.m_bIsSet) { this.NickName = this.MakeNN(true); } else if ((this.m_ID.m_bIsSet && this.m_ID.nValue.Equals(0) || !this.m_ID.m_bIsSet) && PLRefSource.GetIDFromNN(this.NickName) > 0) { this.NickName = this.MakeNN(true); } else if ((this.NickName.Length.Equals(0) ? 1 : (this.NickName.Length > 4 ? 1 : 0)) != 0) { this.NickName = this.MakeNN(true); } PLRefSource.AddNicknameToList(this.NickName); foreach (CPostItem postItem in this.PostItems) { postItem.AddField(this.m_hndPOST); } this.m_ExternalID_1.AddField(this.m_hndPOST); this.m_ExternalID_2.AddField(this.m_hndPOST); this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLRefSource plRefSource = this; plRefSource.m_lCounter = plRefSource.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }
private static void ReadTable() { if (PLRefSource.bRead) { return; } uint num = 0; object szValue = new object(); uint createHandle = PLLink.GetLink().TableGET_CreateHandle("ReferralSources", 0, 0, 0U); PLLink.GetLink().TableGET_AddFilter(createHandle, "RefSourceStatus", "EQ", "0", 1); while (PLLink.GetLink().TableGET_GetNextRecord(createHandle) == 0) { PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "RefSourceNickName", "", ref szValue); string str = szValue.ToString().ToUpper().Trim(); int recordFieldValueI32 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "RefSourceID"); PLRefSource.AddMapNNtoID(str, recordFieldValueI32); PLRefSource.AddMapIDtoNN(recordFieldValueI32, str); PLRefSource.AddNicknameToList(str); } PLLink.GetLink().TableGET_CloseHandle(createHandle); num = 0U; PLRefSource.bRead = true; }