Example #1
0
        /// <summary>
        /// 根据用户编号返回归还单信息,用户编号为空则返回全部
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <returns></returns>
        public DataTable GetRtoByUserId(string userId)
        {
            var list   = _assReturnOrderRepository.GetByUserID(userId).AsNoTracking();
            var result = from returnOrder in list
                         join user in _SMOSECDbContext.coreUsers on returnOrder.RETURNER equals user.USER_ID
                         join location in _SMOSECDbContext.AssLocations on returnOrder.LOCATIONID equals location.LOCATIONID
                         select new
            {
                Rtoid        = returnOrder.RTOID,
                LocationName = location.NAME,
                Returndate   = returnOrder.RETURNDATE,
                Returner     = user.USER_NAME
            };

            return(LINQToDataTable.ToDataTable(result));
        }
Example #2
0
 /// <summary>
 /// 根据用户编号返回归还单信息,用户编号为空则返回全部
 /// </summary>
 /// <param name="userId">用户编号</param>
 /// <param name="LocationId">区域编号</param>
 /// <returns></returns>
 public DataTable GetRtoByUserId(string userId, string LocationId)
 {
     var list = _assReturnOrderRepository.GetByUserID(userId).AsNoTracking();
     if (!string.IsNullOrEmpty(LocationId))
     {
         list = list.Where(a => a.LOCATIONID == LocationId);
     }
     var result = from returnOrder in list
                  join user in _SMOSECDbContext.coreUsers on returnOrder.HANDLEMAN equals user.USER_ID
                  join location in _SMOSECDbContext.AssLocations on returnOrder.LOCATIONID equals location.LOCATIONID
                  select new
                  {
                      Rtoid = returnOrder.RTOID,
                      LocationName = location.NAME,
                      Returndate = returnOrder.RETURNDATE,
                      HandleMan=user.USER_NAME
                  };
     return LINQToDataTable.ToDataTable(result);
 }