public String GetAllCompany() { string count = null; List <T_Company> coms = new List <T_Company>(); coms = new CompanySvc().GetAllCompany(); count = coms.Count().ToString(); T_Company com = new T_Company(); com.Count = count; com.C_GUID = Guid.NewGuid().ToString(); List <T_Company> company = new List <T_Company>(); company.Add(com); string json = new JavaScriptSerializer().Serialize(company); return(json); }
public string GetUserAllList() { string count = null; List <T_User> users = new List <T_User>(); StringBuilder strJson = new StringBuilder("["); users = new CompanySvc().GetUserAllList(); count = users.Count().ToString(); T_User user = new T_User(); user.Count = count; user.U_GUID = Guid.NewGuid().ToString(); user.State = 1; List <T_User> allUser = new List <T_User>(); allUser.Add(user); string json = new JavaScriptSerializer().Serialize(user); strJson.Append(json); strJson.Append("]"); return(strJson.ToString()); }