Exemplo n.º 1
0
        public List <billViewModel> Get_Bill(searchParam model)
        {
            if (model.startdate != "")
            {
                startdate = DateTime.ParseExact(model.startdate, format, CultureInfo.InvariantCulture);
            }
            if (model.enddate != "")
            {
                enddate = DateTime.ParseExact(model.enddate, format, CultureInfo.InvariantCulture);
            }
            IQueryable <billViewModel> queryResult = from a in context.Bill
                                                     where
                                                     (model.startdate == "" || startdate <= a.Date) && (model.enddate == "" || enddate >= a.Date) &&
                                                     (model.NumberBill == "" || a.NumberBill.Contains(model.NumberBill))

                                                     select new billViewModel
            {
                IdBill        = a.IdBill,
                PriceBefore   = a.PriceBefore,
                TotalDiscount = a.TotalDiscount,
                PriceAfter    = a.PriceAfter,
                DateTime      = a.Date,
                NumberBill    = a.NumberBill
            };

            return(queryResult.ToList());
        }
Exemplo n.º 2
0
 // 单独给一个线程来执行
 Task.Factory.StartNew(() => SearchAndResponse(searchParam));
Exemplo n.º 3
0
        public IActionResult Get_Listbill([FromBody] searchParam model) // done
        {
            List <billViewModel> model1 = repository_transaction.Get_Bill(model);

            return(Json(model1));
        }