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