public AscmSupplierAddress Get(int id) { AscmSupplierAddress ascmSupplierAddress = null; try { ascmSupplierAddress = YnDaoHelper.GetInstance().nHibernateHelper.Get <AscmSupplierAddress>(id); } catch (Exception ex) { YnBaseClass2.Helper.LogHelper.GetLog().Error("查询失败(Get AscmSupplierAddress)", ex); throw ex; } return(ascmSupplierAddress); }
public void Update(AscmSupplierAddress ascmSupplierAddress) { using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction()) { try { YnDaoHelper.GetInstance().nHibernateHelper.Update <AscmSupplierAddress>(ascmSupplierAddress); tx.Commit();//正确执行提交 } catch (Exception ex) { tx.Rollback();//回滚 YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmSupplierAddress)", ex); throw ex; } } }