public JObject GetDlInfoList(JObject json) { JObject ret = new JObject(); vw_MallDLInfo dlInfo = json["param"] == null?new vw_MallDLInfo():JsonConvert.DeserializeObject <vw_MallDLInfo>(json["param"].ToString()); Pagination page = JsonConvert.DeserializeObject <Pagination>(json["Pagination"].ToString()); ret = Dlian.GetDlInfoList(dlInfo, page); return(ret); }
public JObject GetDlDetailInfo(string DlNo) { JObject ret = new JObject(); vw_MallDLInfo dlInfo = new vw_MallDLInfo(); dlInfo.DlNo = DlNo; Pagination page = Pagination.GetDefaultPagination("DlNo"); ret.Add("main", JProperty.FromObject(Dlian.GetDlInfoList(dlInfo, page))); ret.Add("detail", JProperty.FromObject(Dlian.GetDlDetaiInfo(DlNo))); return(ret); }
/// <summary> /// 查询代列表 /// </summary> /// <param name="json"></param> /// <returns></returns> public JObject GetDlInfoList(vw_MallDLInfo mallDlInfo, Pagination page) { try { using (var db = new RepositoryBase()) { JObject ret = new JObject(); PaginationResult <List <vw_MallDLInfo> > ResultPage = new PaginationResult <List <vw_MallDLInfo> >(); Expression <Func <vw_MallDLInfo, bool> > expressions = PredicateExtensions.True <vw_MallDLInfo>(); if (mallDlInfo != null) { if (mallDlInfo.GameId != null && mallDlInfo.GameId > 0) { expressions = expressions.And(c => c.GameId == mallDlInfo.GameId); } if (mallDlInfo.GroupId != null && mallDlInfo.GroupId > 0) { expressions = expressions.And(c => c.GroupId == mallDlInfo.GroupId); } if (mallDlInfo.ServerId != null && mallDlInfo.ServerId > 0) { expressions = expressions.And(c => c.ServerId == mallDlInfo.ServerId); } if (!string.IsNullOrEmpty(mallDlInfo.DlType)) { expressions = expressions.And(c => c.DlType == mallDlInfo.DlType); } if (!string.IsNullOrEmpty(mallDlInfo.WorkerType)) { expressions = expressions.And(c => c.WorkerType == mallDlInfo.WorkerType); } if (!string.IsNullOrEmpty(mallDlInfo.DlNo)) { expressions = expressions.And(c => c.DlNo == mallDlInfo.DlNo); } ResultPage.datas = db.FindList(page, out page, expressions); ResultPage.pagination = page; } else { ResultPage.datas = db.FindList <vw_MallDLInfo>(page == null ? Pagination.GetDefaultPagination("GoodNo") : page).ToList(); } ret.Add(ResultInfo.Result, true); ret.Add(ResultInfo.Content, JToken.FromObject(ResultPage)); return(ret); } } catch (Exception ex) { throw new Exception(ex.Message + "处发生了错误!"); } }