コード例 #1
0
 public void Delete(AscmWmsStockTransDetail ascmWmsStockTransDetail)
 {
     try
     {
         YnDaoHelper.GetInstance().nHibernateHelper.Delete<AscmWmsStockTransDetail>(ascmWmsStockTransDetail);
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("删除失败(Delete AscmWmsStockTransDetail)", ex);
         throw ex;
     }
 }
コード例 #2
0
 public void Update(AscmWmsStockTransDetail ascmWmsStockTransDetail)
 {
     try
     {
         using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
         {
             try
             {
                 YnDaoHelper.GetInstance().nHibernateHelper.Update<AscmWmsStockTransDetail>(ascmWmsStockTransDetail);
                 tx.Commit();//正确执行提交
             }
             catch (Exception ex)
             {
                 tx.Rollback();//回滚
                 YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmWmsStockTransDetail)", ex);
                 throw ex;
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Save AscmWmsStockTransDetail)", ex);
         throw ex;
     }
 }