Пример #1
0
        private Resource addImage(Connection connection, Image image)
        {
            Resource resource = new Resource( new HickoryIT.Shared.Data.Type(null, "",""), "testname", "testdescription", "testvalue");

            // TODO: Add the resource to DB
            connection.InsertResource(resource);

            // Get properties of image and add this/those
            Info inf = new Info(image);

            foreach (string propertyname in inf.PropertyItems.Keys)
            {
                Debug.WriteLine(propertyname + ": " + (inf.PropertyItems[propertyname]).ToString());
                Console.WriteLine(propertyname + ": " + (inf.PropertyItems[propertyname]).ToString());
            }
            // TODO: Save image to disc

            return resource;
        }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="resource"></param>
 /// <returns></returns>
 public Resource AddResource(Resource resource)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 public int InsertResource(Resource resource)
 {
     // The tabel Resource has Id as autoincrement
     string values = resource.Name + @"', '" + resource.Type.Id + @"', '" + resource.Description + @"', '" + resource.Value;
     return Insert("Resource", "Name, Type_Id, Description, Value", values);
 }