Пример #1
0
        //---------------------------------------------------------------------------------------------------------------------

        public static RemoteResourceSet FromIdentifier(IfyContext context, string identifier)
        {
            RemoteResourceSet result = new RemoteResourceSet(context);

            result.Identifier = identifier;
            result.Load();
            return(result);
        }
Пример #2
0
        //---------------------------------------------------------------------------------------------------------------------

        public static RemoteResourceSet FromId(IfyContext context, int id)
        {
            RemoteResourceSet result = new RemoteResourceSet(context);

            result.Id = id;
            result.Load();
            return(result);
        }
Пример #3
0
        //---------------------------------------------------------------------------------------------------------------------

        public static RemoteResourceEntityCollection GetResources(IfyContext context, RemoteResourceSet resourceSet)
        {
            RemoteResourceEntityCollection result = new RemoteResourceEntityCollection(context);

            result.Template.ResourceSet = resourceSet;
            IDbConnection dbConnection = context.GetDbConnection();
            IDataReader   reader       = context.GetQueryResult(String.Format("SELECT t.id, t.location, t.name FROM resource AS t WHERE id_set={0}", resourceSet.Id), dbConnection);

            while (reader.Read())
            {
                RemoteResource resource = new RemoteResource(context);
                resource.Id          = reader.GetInt32(0);
                resource.ResourceSet = resourceSet;
                resource.Location    = reader.GetString(1);
                resource.Name        = reader.GetString(2);
            }
            context.CloseQueryResult(reader, dbConnection);
            return(result);
        }