Exemple #1
0
        public object GetSampleList(SeachModel seachObj)
        {
            var exp = PredicateBuilder.True <ISampleBaseInfo>();

            exp = exp.And(p => !p.IsDelete && (int)p.State > 2);
            if (seachObj.State != SampleState.所有)
            {
                exp = exp.And(p => p.State == seachObj.State);
            }
            ;
            if (seachObj.DateValue.Count() > 1)
            {
                var d1 = seachObj.DateValue[0];
                var d2 = seachObj.DateValue[1].AddDays(1);
                exp = exp.And(p => p.CreateDate >= d1 & p.CreateDate < d2);
            }
            ;
            if (seachObj.KeyWord != "")
            {
                exp = exp.And(p => p.SeachStr.Contains(seachObj.KeyWord));
            }

            var re = SampleOper.GetSampleListOrderByDesc(exp.Compile(), t => t.State, seachObj.Current, seachObj.PageSize);

            return(Ok(re));
        }
Exemple #2
0
        public object GetNotInStorageSample(dynamic seachObj)
        {
            string ddid     = SessionManage.CurrentUser.DdId;
            string cstr     = (string)seachObj.current;;
            string cpage    = seachObj.pageSize;
            int    current  = cstr == "" ? 1 : int.Parse(cstr);
            int    pageSize = cpage == "" ? 20 : int.Parse(cpage);
            var    re       = SampleOper.GetSampleListOrderByDesc(p => !p.IsDelete && p.DdId == ddid && (int)p.State <= 2, t => t.State, current, pageSize);

            return(Ok(re));
        }
Exemple #3
0
        public object GetInStorageList(SeachModel obj)
        {
            object re;

            if (obj.UserId.Count > 0)
            {
                var exp  = PredicateBuilder.False <ISampleBaseInfo>();
                var exp2 = PredicateBuilder.True <ISampleBaseInfo>();
                obj.UserId.ForEach(p =>
                {
                    exp = exp.Or(t => t.DdId == p);
                });
                exp2 = exp2.And(p => !p.IsDelete && p.State == SampleState.待入库).And(exp);

                re = SampleOper.GetSampleListOrderByDesc(exp2.Compile(), p => p.CreateDate, obj.Current, obj.PageSize);
            }
            else
            {
                re = SampleOper.GetSampleListOrderByDesc(p => !p.IsDelete && p.State == SampleState.待入库, p => p.CreateDate, obj.Current, obj.PageSize);
            }

            return(Ok(re));
        }