Exemplo n.º 1
0
 public void AddPiktogram(string name, medium obj)
 {
     var piktogram = db.CreateObject<piktogramy>();
     piktogram.name = name;
     piktogram.media_id = obj.id;
     db.piktogramies.AddObject(piktogram);
     db.SaveChanges();
 }
Exemplo n.º 2
0
        public piktogramy EditPiktogram(int id, string name = null, medium obj = null, string categoryName = null)
        {
            piktogramy pikt = GetPiktogram(id);
            pikt.name = name ?? pikt.name;
            pikt.media_id = obj.id;

            if (categoryName != null)
            {
                category cat = GetCategory(categoryName);
                pikt.category_id = cat.id;
            }

            db.SaveChanges();
            return pikt;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new medium object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="media_type_id">Initial value of the media_type_id property.</param>
 /// <param name="object">Initial value of the object property.</param>
 public static medium Createmedium(global::System.Int64 id, global::System.Int64 media_type_id, global::System.Byte[] @object)
 {
     medium medium = new medium();
     medium.id = id;
     medium.media_type_id = media_type_id;
     medium.@object = @object;
     return medium;
 }
Exemplo n.º 4
0
        public void AddPiktogram(string name, medium obj, string categoryName)
        {
            var piktogram = db.CreateObject<piktogramy>();
            piktogram.name = name;
            piktogram.media_id = obj.id;

            category cat = GetCategory(categoryName);
            if (cat == null)
            {
                AddCategory(categoryName);
                cat = GetCategory(categoryName);
            }
            piktogram.category_id = cat.id;

            db.piktogramies.AddObject(piktogram);
            db.SaveChanges();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the media EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTomedia(medium medium)
 {
     base.AddObject("media", medium);
 }