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

                AscmTruckSwipeLog ascmTruckSwipeLog = new AscmTruckSwipeLog();
                ascmTruckSwipeLog.createTime = createTime.ToString("yyyy-MM-dd HH:mm:ss");
                ascmTruckSwipeLog.modifyTime = dtServerTime.ToString("yyyy-MM-dd HH:mm:ss");

                ascmTruckSwipeLog.doorId = doorId;
                ascmTruckSwipeLog.readingHeadId = 0;
                ascmTruckSwipeLog.readingHead = readingHead;
                ascmTruckSwipeLog.rfid = rfid;
                ascmTruckSwipeLog.supplierId = supplierId;
                ascmTruckSwipeLog.driverId = driverId;
                ascmTruckSwipeLog.supplierName = supplierName;
                ascmTruckSwipeLog.driverName = driverName;
                ascmTruckSwipeLog.plateNumber = plateNumber;

                ascmTruckSwipeLog.status = 1;
                ascmTruckSwipeLog.pass = pass;
                ascmTruckSwipeLog.direction = direction;
                ascmTruckSwipeLog.description = description;

                ascmTruckSwipeLog.batSumMainId = batSumMainId;
                ascmTruckSwipeLog.batSumDocNumber = batSumDocNumber;
                ascmTruckSwipeLog.onTime = onTime;
                ascmTruckSwipeLog.appointmentStartTime = appointmentStartTime;
                ascmTruckSwipeLog.appointmentEndTime = appointmentEndTime;

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