public JArray accList() { var list = AccountManage.getAccountList(""); list = list.Where(x => x.status == 0).ToList(); JArray json = new JArray( from r in list select new JObject( new JProperty("ID", r.databaseName), new JProperty("name", r.accountName))); return(json); }
public JObject getList(string accName, int page, int limit) { List <Account> list = AccountManage.getAccountList(accName); var list1 = list.Skip((page - 1) * limit).Take(limit).ToList(); JObject json = new JObject( new JProperty("code", 0), new JProperty("msg", ""), new JProperty("count", list.Count), new JProperty("data", new JArray( from r in list1 select new JObject( new JProperty("accountID", r.accountID), new JProperty("accountName", r.accountName), new JProperty("creatDate", r.creatDate), new JProperty("databaseName", r.databaseName), new JProperty("databasePath", r.databasePath), new JProperty("ID", r.ID), new JProperty("remark", r.remark), new JProperty("status", r.status))))); return(json); }