コード例 #1
0
        public List <SelectListItem> GetSelectListOperationalSiteLocationsByAssetOwnwer(long assetOwnerID)
        {
            AssetOwner assetOwner = repositoryAssetOwner.FindById(assetOwnerID);

            var data = new List <SelectListItem>();

            if (assetOwner.OperationalSiteId != null)
            {
                data = repositoryOperationalSiteLocation.GetOperationalSiteLocationsByOwner(assetOwner.OperationalSiteId.Value)
                       .Select(x => new SelectListItem
                {
                    Value = x.OperationalSiteLocationID.ToString(),
                    Text  = x.Location.LocationDescription
                })
                       .OrderBy(x => x.Text)
                       .ToList();
            }

            return(data);
        }
コード例 #2
0
 public AssetOwner FindById(long id)
 {
     return(repository.FindById(id));
 }