欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

winfrom 在業(yè)務(wù)層實現(xiàn)事務(wù)控制的小例子

 更新時間:2013年03月30日 13:41:19   作者:  
winfrom 在業(yè)務(wù)層實現(xiàn)事務(wù)控制的小例子,需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

try
    {
 using (TransactionScope tr = new TransactionScope())
 {
     int i = this.customermanager.addCustomer(customer);
     int j = this.homestatusmanager.updateHomestatus(homestatus);
     if ((i * j) > 0)
     {
  MessageBox.Show("記錄插入成功!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
  Empty();
  tr.Complete();
     }
     else
     {
  MessageBox.Show("記錄插入失??!聯(lián)系管理員!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
  Empty();
     }
     tr.Dispose();
 }

    }
    catch(Exception err)
    {
 MessageBox.Show("記錄插入失敗" +err.ToString(), "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }

相關(guān)文章

最新評論