/// <summary> /// 返回当前用户的待借出清单 /// </summary> /// <param name="_user"></param> /// <returns></returns> public static object GetLendList(User _user) { using (SunginDataContext sc = new SunginDataContext()) { //SampleLendout slo = sc.SampleLendouts.SingleOrDefault(p => p.DdId == _user.DdId && p.State == LendStats.草拟); var lendlist = sc.LendRecords.Where(p => p.DdId == _user.DdId && p.State == LendRecordStats.草拟).ToList(); List <object> lo = new List <object>(); lendlist.ForEach(p => { var obj = SampleHelper.GetDdLenOutObj(p); if (obj != null) { lo.Add(obj); } }); return(lo); } }
/// <summary> /// 当前用户的借出清单 /// </summary> /// <param name="user"></param> /// <returns></returns> public static object GetLendOutListDD(User _user) { using (SunginDataContext sc = new SunginDataContext()) { var lendlist = sc.LendRecords.Where(p => p.DdId == _user.DdId && (p.State == LendRecordStats.借出审批 || p.State == LendRecordStats.已借出)).ToList(); List <object> lo = new List <object>(); lendlist.ForEach(p => { var obj = SampleHelper.GetDdLenOutObj(p); if (obj != null) { lo.Add(obj); } }); if (lo.Count == 0) { lo = null; } return(lo); } }