예제 #1
0
    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);
        }
    }
예제 #2
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();
            }
        }
    }
예제 #3
0
 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();
             }
         }
     }
 }
예제 #4
0
		public void DeleteLoadTest() {
			DeleteCriteria del_crit = new DeleteCriteria((new TestObject()).Type, "( Name = '" + m_obj_name + "')");
			del_crit.Perform();
		}
예제 #5
0
파일: Program.cs 프로젝트: olexta/Toolkit
		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 );
			}
		}
예제 #6
0
파일: ODBTest.cs 프로젝트: olexta/Toolkit
	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!" );
	}