/************************************************************************************************** 功能:删除记录 参数:ID,删除的记录的ID 返回:-2,数据库尚未连接 -3, 从列表中删除记录失败 -4, 数据库删除操作失败 0, 成功 作者:佘佳明 2014-11-24 **************************************************************************************************/ int CHistoryTicketItemListMgt::del( const DWORD32 ID ) { if(!m_isInit) return -2; if( checkDBConnect() < 0 ) return -4; int ret = isIDExist(ID); if(ret < 0) return -5; char *sql = (char*)"DELETE FROM t_historyticketitemlist WHERE ID = :f1_ID<unsigned int>"; try { otl_stream delStream(1, sql, m_db); delStream << ID; printf("数据库删除记录 ID: %d\n", ID); m_db.commit(); int ret = delFromList(ID); if(ret < 0) return -3; } catch (otl_exception& p) { WLOutDebug("删除票项表操作失败!"); cerr<<p.msg<<endl; // print out error message cerr<<p.stm_text<<endl; // print out SQL that caused the error cerr<<p.sqlstate<<endl; // print out SQLSTATE message cerr<<p.var_info<<endl; // print out the variable that caused the error return -4; } return 0; }
static void onDestroyWidget(GtkWidget *w, gpointer data) { PluginInstance* This = (PluginInstance*) data; if (This && This->dialogBox && This->dialogBox == w) { This->dialogBox = 0; delFromList(&head, This); } }
static void freeMailInfo(struct MHINFO *w) { struct MHINFO *v; while (!listIsEmpty(&w->components)) { v = w->components.next; delFromList(v); freeMailInfo(v); } nzFree(w->tolist); nzFree(w->cclist); nzFree(w); } /* freeMailInfo */
//############################################################################## //# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # //############################################################################## void xHashMap::clear() { for(register int i = 0;i < m_table->size();i++) { if((*m_table)[i] != NULL) { Node* tmp = (*m_table)[i]; while(tmp != NULL) tmp = delFromList(tmp->key,tmp); (*m_table)[i] = NULL; } } }
static void acceptCookie(struct cookie *c) { struct cookie *d; displacedCookie = false; foreach(d, cookies) { if (stringEqualCI(d->name, c->name) && stringEqualCI(d->domain, c->domain)) { displacedCookie = true; delFromList(d); freeCookie(d); nzFree(d); break; } } addToListBack(&cookies, c); } /* acceptCookie */
//############################################################################## //# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # //############################################################################## void xHashMap::remove(xObject& key) throw(xClassCastException) { int index = indexOf(hash(&key)); (*m_table)[index] = delFromList(&key,(*m_table)[index]); }