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