Ejemplo n.º 1
0
 public void Update(Request item)
 {
     if (item != null)
     {
         DB.Entry(item).State = EntityState.Modified;
     }
 }
Ejemplo n.º 2
0
 public void Update(Employee item)
 {
     if (item != null)
     {
         DB.Entry(item).State = EntityState.Modified;
     }
 }
        private void HandleConcurrencyError(DbUpdateConcurrencyException ex)
        {
            ex.Entries.Single().Reload();

            var state = context.Entry(selectedProduct).State;

            if (state == EntityState.Detached)
            {
                MessageBox.Show("Another user has deleted that product.",
                                "Concurrency Error");
            }
            else
            {
                string message = "Another user has updated that product.\n" +
                                 "The current database values will be displayed.";
                MessageBox.Show(message, "Concurrency Error");
            }
            this.DisplayProducts();
        }