public JsonResult LoadOrganizations() { string strErrText; OrganizationSystem organ = new OrganizationSystem(); List <Organization> listOrganization = organ.LoadOrganizations(LoginAccountId, LoginStaffName, out strErrText); if (listOrganization == null) { throw new Exception(strErrText); } var ret = from o in listOrganization select new { o.Id, o.Name, o.FullName, o.ParentId, o.ManagerName }; return(Json(ret, JsonRequestBehavior.AllowGet)); }
public JsonResult LoadOrganization(long nOrganId) { string strErrText; OrganizationSystem organ = new OrganizationSystem(); Organization data = organ.LoadOrganization(nOrganId, LoginAccountId, LoginStaffName, out strErrText); if (data == null) { return(Json(null, JsonRequestBehavior.AllowGet)); } else { var ret = new { Id = data.Id, Name = data.Name, CountryName = data.CountryName, ProvinceName = data.ProvinceName, CityName = data.CityName }; return(Json(ret, JsonRequestBehavior.AllowGet)); } }