public void Delete(AscmEmpCarSwipeLog ascmEmpCarSwipeLog)
 {
     try
     {
         YnDaoHelper.GetInstance().nHibernateHelper.Delete<AscmEmpCarSwipeLog>(ascmEmpCarSwipeLog);
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("删除失败(Delete AscmEmpCarSwipeLog)", ex);
         throw ex;
     }
 }
 public void Save(AscmEmpCarSwipeLog ascmEmpCarSwipeLog)
 {
     try
     {
         using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
         {
             try
             {
                 YnDaoHelper.GetInstance().nHibernateHelper.Save(ascmEmpCarSwipeLog);
                 tx.Commit();//正确执行提交
             }
             catch (Exception ex)
             {
                 tx.Rollback();//回滚
                 throw ex;
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("保存失败(Save AscmEmpCarSwipeLog)", ex);
         throw ex;
     }
 }
 public void Update(AscmEmpCarSwipeLog ascmEmpCarSwipeLog)
 {
     //int count = YnDaoHelper.GetInstance().nHibernateHelper.GetCount("select count(*) from AscmEmpCarSwipeLog where id<>" + ascmEmpCarSwipeLog.id + " and docNumber='" + ascmEmpCarSwipeLog.docNumber + "'");
     //if (count == 0)
     //{
     //    using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
     //    {
     //        try
     //        {
     //            YnDaoHelper.GetInstance().nHibernateHelper.Update<AscmEmpCarSwipeLog>(ascmEmpCarSwipeLog);
     //            tx.Commit();//正确执行提交
     //        }
     //        catch (Exception ex)
     //        {
     //            tx.Rollback();//回滚
     //            YnBaseClass2.Helper.LogHelper.GetLog().Error("修改失败(Update AscmEmpCarSwipeLog)", ex);
     //            throw ex;
     //        }
     //    }
     //}
     //else
     //{
     //    throw new Exception("已经存在员工编号\"" + ascmEmpCarSwipeLog.name + "\"!");
     //}
 }
        public AscmEmpCarSwipeLog GetAddLog(int doorId, string readingHead, string rfid, string employeeName, string plateNumber, bool pass, string description, DateTime createTime, string direction)
        {
            try
            {
                DateTime dtServerTime = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentDate("AscmEmpCarSwipeLog");

                AscmEmpCarSwipeLog ascmEmpCarSwipeLog = new AscmEmpCarSwipeLog();
                ascmEmpCarSwipeLog.doorId = doorId;
                ascmEmpCarSwipeLog.readingHeadId = 0;
                ascmEmpCarSwipeLog.readingHead = readingHead;
                ascmEmpCarSwipeLog.rfid = rfid;
                ascmEmpCarSwipeLog.employeeName = employeeName;
                ascmEmpCarSwipeLog.plateNumber = plateNumber;
                ascmEmpCarSwipeLog.createTime = createTime.ToString("yyyy-MM-dd HH:mm:ss");
                ascmEmpCarSwipeLog.modifyTime = dtServerTime.ToString("yyyy-MM-dd HH:mm:ss");
                ascmEmpCarSwipeLog.status = 1;
                ascmEmpCarSwipeLog.pass = pass;
                ascmEmpCarSwipeLog.direction = direction;
                ascmEmpCarSwipeLog.description = description;

                return ascmEmpCarSwipeLog;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }