コード例 #1
0
 public void DeleteEmployeeHistoryEntry(EmployeeHistoryEntry employeeHistoryEntry)
 {
     if ((employeeHistoryEntry.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeHistoryEntry, EntityState.Deleted);
     }
     else
     {
         this.ObjectContext.EmployeeHistoryEntries.Attach(employeeHistoryEntry);
         this.ObjectContext.EmployeeHistoryEntries.DeleteObject(employeeHistoryEntry);
     }
 }
コード例 #2
0
        public void UpdateEmployeeHistoryEntry(EmployeeHistoryEntry currentEmployeeHistoryEntry)
        {
            currentEmployeeHistoryEntry.LastModified = DateTime.UtcNow;
            currentEmployeeHistoryEntry.LastModifyingUserId = CurrentUserAccount().Id;

            this.ObjectContext.EmployeeHistoryEntries.AttachAsModified(currentEmployeeHistoryEntry);
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EmployeeHistoryEntries EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEmployeeHistoryEntries(EmployeeHistoryEntry employeeHistoryEntry)
 {
     base.AddObject("EmployeeHistoryEntries", employeeHistoryEntry);
 }
コード例 #4
0
 public void InsertEmployeeHistoryEntry(EmployeeHistoryEntry employeeHistoryEntry)
 {
     if ((employeeHistoryEntry.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(employeeHistoryEntry, EntityState.Added);
     }
     else
     {
         this.ObjectContext.EmployeeHistoryEntries.AddObject(employeeHistoryEntry);
     }
 }
コード例 #5
0
 /// <summary>
 /// Create a new EmployeeHistoryEntry object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="employeeId">Initial value of the EmployeeId property.</param>
 /// <param name="createdDate">Initial value of the CreatedDate property.</param>
 public static EmployeeHistoryEntry CreateEmployeeHistoryEntry(global::System.Guid id, global::System.Guid employeeId, global::System.DateTime createdDate)
 {
     EmployeeHistoryEntry employeeHistoryEntry = new EmployeeHistoryEntry();
     employeeHistoryEntry.Id = id;
     employeeHistoryEntry.EmployeeId = employeeId;
     employeeHistoryEntry.CreatedDate = createdDate;
     return employeeHistoryEntry;
 }