Esempio n. 1
0
 public static bool AddWidGet(WidGet data)
 {
     using (InventioEntities context = new InventioEntities())
     {
         context.AddToWidGet(data);
         context.SaveChanges();
     }
     return true;
 }
Esempio n. 2
0
        public static bool AddWidGet(string IdContainer, string type, int position, string DataXML)
        {
            WidGet widget = new WidGet();
            widget.IdContainer = IdContainer;
            widget.Type = type;
            widget.Position = position;
            widget.Data = DataXML;

            AddWidGet(widget);

            return true;
        }
Esempio n. 3
0
 public static bool UpdateWidGet(WidGet data)
 {
     using (InventioEntities context = new InventioEntities())
     {
         data.EntityKey = new EntityKey("InventioEntities.WidGet", "ID", data.ID);
         context.Attach(data);
         context.ObjectStateManager.GetObjectStateEntry(data).SetModified();
         context.Refresh(RefreshMode.ClientWins, data);
         context.SaveChanges();
     }
     return true;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the WidGet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWidGet(WidGet widGet)
 {
     base.AddObject("WidGet", widGet);
 }
 /// <summary>
 /// Create a new WidGet object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="idContainer">Initial value of the IdContainer property.</param>
 /// <param name="type">Initial value of the Type property.</param>
 public static WidGet CreateWidGet(global::System.Int32 id, global::System.String idContainer, global::System.String type)
 {
     WidGet widGet = new WidGet();
     widGet.ID = id;
     widGet.IdContainer = idContainer;
     widGet.Type = type;
     return widGet;
 }