public void DeleteSalesTerm(SalesTerm salesTerm)
        {
            if ((salesTerm.EntityState == EntityState.Detached))
                this.ObjectContext.SalesTerms.Attach(salesTerm);

            this.ObjectContext.SalesTerms.DeleteObject(salesTerm);
        }
 public void InsertSalesTerm(SalesTerm salesTerm)
 {
     if ((salesTerm.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(salesTerm, EntityState.Added);
     }
     else
     {
         this.ObjectContext.SalesTerms.AddObject(salesTerm);
     }
 }
 public void UpdateSalesTerm(SalesTerm currentSalesTerm)
 {
     this.ObjectContext.SalesTerms.AttachAsModified(currentSalesTerm);
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SalesTerms EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSalesTerms(SalesTerm salesTerm)
 {
     base.AddObject("SalesTerms", salesTerm);
 }
示例#5
0
 /// <summary>
 /// Create a new SalesTerm object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static SalesTerm CreateSalesTerm(global::System.Guid id, global::System.String name)
 {
     SalesTerm salesTerm = new SalesTerm();
     salesTerm.Id = id;
     salesTerm.Name = name;
     return salesTerm;
 }