Example #1
0
        public static ModelUsers FindModelUserByID(ModelSite site, int id)
        {
            ModelSite user = new ModelSite();

            return(site.modelUsers.Find(delegate(ModelUsers u) {
                return u.Id == id;
            }));

            //for (int i = 0; i < user.modelUsers.Count; i++) {
            //    if (user.modelUsers[i].Id == id) {
            //        return user.modelUsers[i];
            //    }
            //}
            //return null;
        }
Example #2
0
        //根据站点ID,获取站点信息
        public static ModelSite FindSiteByID(int siteID)
        {
            ModelSite site = new ModelSite();

            return(ModelMain.AllData.SiteList.Find(delegate(ModelSite s) {
                return s.SiteID == siteID;
            }));

            //for (int i = 0; i < ModelMain.AllData.SiteList.Count; i++) {
            //    if (ModelMain.AllData.SiteList[i].SiteID == siteID) {
            //        site = ModelMain.AllData.SiteList[i];
            //    }
            //}
            //return site;
        }