public MODEL.DataTableModel.DataTableGrid GetOrderForGrid(MODEL.DataTableModel.DataTableRequest request) { try { var predicate = PredicateBuilder.True <TG_order>(); DateTime time = TypeParser.ToDateTime("1975-1-1"); int total = 0; var list = IDBSession.ISYS_USERLOGIN_REPOSITORY.LoadListBy(su => su.LOGIN_ID == OperateContext.Current.UsrId).Select(su => su.SLSORG_CD); var userlist = IDBSession.IYX_weiUser_REPOSITORY.LoadListBy(wu => list.Contains(wu.TREE_NODE_ID)).Select(su => su.userNum); predicate = predicate.And(o => o.SYNCOPERATION != "D" && userlist.Contains(o.UserId)); var data = base.LoadPagedList(request.PageNumber, request.PageSize, ref total, predicate, request.Model, p => true, request.SortOrder, request.SortName).ToList();//Select(p => VIEW_TG_order.ToViewModel(p)); //var list = ViewModelProduct.ToListViewModel(data); return(new MODEL.DataTableModel.DataTableGrid() { draw = request.Draw, data = VIEW_TG_order.ToListViewModel(data), total = total }); } catch (Exception) { throw; } }
public ActionResult ReservationList() { ViewBag.PageFlag = "ReservationList"; var status = false; var userid = CommonMethod.getCookie("userid"); var openid = CommonMethod.getCookie("openid"); if (string.IsNullOrEmpty(userid) || string.IsNullOrEmpty(openid)) { return(Content("对不起,请登陆系统!")); } ViewBag.OrderList = VIEW_TG_order.ToListViewModel(orderB.GetListBy(s => s.UserId == userid && s.userOpenId == openid && s.trade_type == "JSAPI" && s.SYNCOPERATION != "D", o => o.orderTime, false)); return(View()); }