public void Delete(AscmUnloadingPointLog ascmUnloadingPointLog)
 {
     try
     {
         YnDaoHelper.GetInstance().nHibernateHelper.Delete<AscmUnloadingPointLog>(ascmUnloadingPointLog);
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("删除失败(Delete AscmUnloadingPointLog)", ex);
         throw ex;
     }
 }
        public void UpdateStatus(int id, string status, string sessionKey)
        {
            try
            {
                AscmUnloadingPoint ascmUnloadingPoint = YnDaoHelper.GetInstance().nHibernateHelper.Get<AscmUnloadingPoint>(id, sessionKey);
                if (ascmUnloadingPoint == null)
                    throw new Exception("找不到卸货点");
                ascmUnloadingPoint.status = status;
                ascmUnloadingPoint.modifyTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:ss");

                DateTime dtServerTime = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentDate("AscmUnloadingPointLog", sessionKey);

                AscmUnloadingPointLog ascmUnloadingPointLog = new AscmUnloadingPointLog();
                ascmUnloadingPointLog.createTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                ascmUnloadingPointLog.modifyTime = dtServerTime.ToString("yyyy-MM-dd HH:mm:ss");
                ascmUnloadingPointLog.unloadingPointId = ascmUnloadingPoint.id;
                ascmUnloadingPointLog.unloadingPointName = ascmUnloadingPoint.name;
                ascmUnloadingPointLog.unloadingPointSn = ascmUnloadingPoint.sn;
                ascmUnloadingPointLog.unloadingPointStatus = ascmUnloadingPoint.status;

                using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession(sessionKey).BeginTransaction())
                {
                    try
                    {
                        YnDaoHelper.GetInstance().nHibernateHelper.Update(ascmUnloadingPoint, sessionKey);
                        if (ascmUnloadingPointLog != null)
                            YnDaoHelper.GetInstance().nHibernateHelper.Save(ascmUnloadingPointLog, sessionKey);
                        tx.Commit();//正确执行提交
                    }
                    catch (Exception ex)
                    {
                        tx.Rollback();//回滚
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                YnBaseClass2.Helper.LogHelper.GetLog().Error("修改状态失败(Update AscmUnloadingPoint Status)", ex);
                throw ex;
            }
        }
 public void Save(AscmUnloadingPointLog ascmUnloadingPointLog)
 {
     try
     {
         using (ITransaction tx = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentSession().BeginTransaction())
         {
             try
             {
                 YnDaoHelper.GetInstance().nHibernateHelper.Save(ascmUnloadingPointLog);
                 tx.Commit();//正确执行提交
             }
             catch (Exception ex)
             {
                 tx.Rollback();//回滚
                 throw ex;
             }
         }
     }
     catch (Exception ex)
     {
         YnBaseClass2.Helper.LogHelper.GetLog().Error("保存失败(Save AscmUnloadingPointLog)", ex);
         throw ex;
     }
 }
        public AscmUnloadingPointLog GetAddLog(int unloadingPointId, string unloadingPointName, string unloadingPointSn, string unloadingPointStatus, DateTime createTime)
        {
            try
            {
                DateTime dtServerTime = YnDaoHelper.GetInstance().nHibernateHelper.GetCurrentDate("AscmUnloadingPointLog");

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

                ascmUnloadingPointLog.unloadingPointId = unloadingPointId;
                ascmUnloadingPointLog.unloadingPointName = unloadingPointName;
                ascmUnloadingPointLog.unloadingPointSn = unloadingPointSn;
                ascmUnloadingPointLog.unloadingPointStatus = unloadingPointStatus;

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