예제 #1
0
 /// <summary>
 /// 注册仓库
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int Add(StorageEntity entity)
 {
     //如果是默认仓库
     if (entity.IsDefault == (int)EBool.Yes)
     {
         StorageEntity temp = new StorageEntity();
         temp.Where(a => a.IsDefault == (int)EBool.Yes);
         if (this.Storage.GetCount(temp) > 0)
         {
             temp = new StorageEntity();
             temp.IsDefault = (int)EBool.No;
             temp.IncludeIsDefault(true);
             temp.Where(a => a.IsDefault == (int)EBool.Yes);
             this.Storage.Update(temp);
         }
     }
     entity.IncludeAll();
     int line = this.Storage.Add(entity);
     if (line > 0)
     {
         Clear();
     }
     return line;
 }
예제 #2
0
 /// <summary>
 /// 查询分页
 /// </summary>
 /// <param name="pageInfo"></param>
 /// <returns></returns>
 public List<StorageEntity> GetList(StorageEntity entity, ref PageInfo pageInfo)
 {
     try
     {
         entity.IncludeAll();
         entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
         entity.OrderBy(a => a.ID, EOrderBy.DESC);
         int rowCount = 0;
         List<StorageEntity> listResult = this.Storage.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);
         pageInfo.RowCount = rowCount;
         return listResult;
     }
     catch
     {
         return null;
     }
 }
예제 #3
0
 /// <summary>
 /// 根据仓库编码查询仓库信息
 /// </summary>
 /// <param name="storageNum"></param>
 /// <returns></returns>
 public StorageEntity GetSingleByNum(string storageNum)
 {
     StorageEntity entity = new StorageEntity();
     entity.IncludeAll();
     entity.Where(a => a.StorageNum == storageNum);
     entity = this.Storage.GetSingle(entity);
     return entity;
 }
예제 #4
0
 /// <summary>
 /// 查询所有的仓库数据信息
 /// </summary>
 /// <returns></returns>
 public List<StorageEntity> GetList()
 {
     StorageEntity entity = new StorageEntity();
     entity.IncludeAll();
     entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
     List<StorageEntity> listResult = this.Storage.GetList();
     return listResult;
 }