private void DelNotes(string id) { DeleteCriteria dcnote = new DeleteCriteria(typeof(XiHuan_GuestBookEntity)); Condition cnote = dcnote.GetNewCondition(); cnote.AddEqualTo(XiHuan_GuestBookEntity.__ID, id); if (dcnote.Perform() > 0) { Alert("恭喜:留言已成功删除!"); BindNotes(0); } }
protected void lnkDelMessage_Click(object sender, EventArgs e) { DeleteCriteria dcmessage = new DeleteCriteria(typeof(XiHuan_MessageEntity)); Condition cmessage = dcmessage.GetNewCondition(); cmessage.AddEqualTo(XiHuan_MessageEntity.__ID, hidId.Value); if (dcmessage.Perform() > 0) { Alert("恭喜:短消息已成功删除!"); if (CommonMethod.FinalString(Request["type"]) == "receive") { BindReceive(); } else { BindSend(); } } }
protected void lnkDelMultiMessage_Click(object sender, EventArgs e) { string[] mid = hidId.Value.Trim().TrimEnd(',').Split(','); if (mid.Length > 0) { DeleteCriteria dcnotes = new DeleteCriteria(typeof(XiHuan_MessageEntity)); Condition cnotes = dcnotes.GetNewCondition(); cnotes.AddIn(XiHuan_MessageEntity.__ID, mid); if (dcnotes.Perform() > 0) { Alert("恭喜:选中的短消息已成功删除!"); if (CommonMethod.FinalString(Request["type"]) == "receive") { BindReceive(); } else { BindSend(); } } } }
public void DeleteLoadTest() { DeleteCriteria del_crit = new DeleteCriteria((new TestObject()).Type, "( Name = '" + m_obj_name + "')"); del_crit.Perform(); }
private void cmdDelete() { string sWhere = ""; Console.WriteLine( "Enter SQL Where condition ex.:(Name = 'test')" ); sWhere = Console.ReadLine(); if ( string.IsNullOrEmpty( sWhere ) ) { sWhere = "(Name like '%')"; } if( m_trans == null ) { DeleteCriteria crit = new DeleteCriteria( (new TestObject()).Type, sWhere ); crit.Perform(); Console.WriteLine( "{0} : Delete request completed = {1}",DateTime.Now.ToLongTimeString(), crit.Count ); } else { RetrieveCriteria rt = new RetrieveCriteria((new TestObject()).Type, sWhere ); rt.Perform(); m_trans.Add( rt, PersistentTransaction.ACTION.Delete ); Console.WriteLine( "{0} : added to delete transaction = {1}", DateTime.Now.ToLongTimeString(), rt.Count ); } }
public void DeleteTest() { //RetrieveCriteria ret_crit = new RetrieveCriteria( // (new TestObject()).Type, // "( name LIKE '" + m_obj_name + "%' )" ); //ret_crit.Perform(); //Assert.IsFalse( ret_crit.CountFound == 0, // "Search for delete returned no objects" ); DeleteCriteria del_crit = new DeleteCriteria( (new TestObject()).Type, "( name LIKE '" + m_obj_name + "%' )" ); del_crit.Perform(); //ret_crit = new RetrieveCriteria( // (new TestObject()).Type, // "( name LIKE '" + m_obj_name + "%' )" ); //ret_crit.AsProxies = true; //ret_crit.Perform(); //Assert.IsFalse( ret_crit.CountFound > 0, "Not all objects was deleted!" ); }