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