public bool SetItemDownloadLog(ItemDownloadLogEntity info, out string strError)
 {
     try
     {
         var itemDownloadList = _currentDAO.QueryByEntity(new ItemDownloadLogEntity()
         {
             ItemId   = info.ItemId
             , UserId = info.UserId
         }, null);
         if (itemDownloadList == null || itemDownloadList.Length == 0)
         {
             info.LogId = BaseService.NewGuidPub();
             info.Count = 1;
             _currentDAO.Create(info);
         }
         else
         {
             var itemDownloadInfo = itemDownloadList[0];
             itemDownloadInfo.Count          = itemDownloadInfo.Count + 1;
             itemDownloadInfo.LastUpdateTime = info.LastUpdateTime;
             _currentDAO.Update(itemDownloadInfo);
         }
         strError = "成功";
         return(true);
     }
     catch (Exception ex) {
         strError = ex.ToString();
         return(false);
     }
 }
        public ItemDownloadLogEntity GetDownloadUsersByItem(string ItemId, int Page, int PageSize, out string strErroe)
        {
            ItemDownloadLogEntity info = new ItemDownloadLogEntity();

            try
            {
                info.TotalCount = _currentDAO.GetDownloadUsersByItemCount(ItemId);
                IList <ItemDownloadLogEntity> list = new List <ItemDownloadLogEntity>();
                DataSet ds = new DataSet();
                ds = _currentDAO.GetDownloadUsersByItem(ItemId, Page, PageSize);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    list = DataTableToObject.ConvertToList <ItemDownloadLogEntity>(ds.Tables[0]);
                }
                strErroe = "ok";
                info.ItemDownloadLogList = list;
            }
            catch (Exception ex) {
                strErroe = ex.ToString();
            }
            return(info);
        }
 public void Update(ItemDownloadLogEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(ItemDownloadLogEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(ItemDownloadLogEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(ItemDownloadLogEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <ItemDownloadLogEntity> PagedQueryByEntity(ItemDownloadLogEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public ItemDownloadLogEntity[] QueryByEntity(ItemDownloadLogEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(ItemDownloadLogEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
 public void Update(ItemDownloadLogEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(ItemDownloadLogEntity pEntity)
 {
     Update(pEntity, true);
 }