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

            try
            {
                ascmWorkshopBuilding = YnDaoHelper.GetInstance().nHibernateHelper.Get <AscmWorkshopBuilding>(id);
            }
            catch (Exception ex)
            {
                YnBaseClass2.Helper.LogHelper.GetLog().Error("查询失败(Get AscmWorkshopBuilding)", ex);
                throw ex;
            }
            return(ascmWorkshopBuilding);
        }