Ejemplo n.º 1
0
 public static void UpdateUser(User user)
 {
     using (AladingWebEntities context = ContextProvider.DataContext(ConnectionHelper.ConnectionString))
     {
         var old = context.User.FirstOrDefault(p => p.UserCode == user.UserCode);
         if (old != null)
         {
             context.Attach(old);
             context.ApplyPropertyChanges("User", user);
             context.SaveChanges();
         }
     }
 }
Ejemplo n.º 2
0
 public static void UpdateShop(Shop shop)
 {
     using (AladingWebEntities context = ContextProvider.DataContext(ConnectionHelper.ConnectionString))
     {
         var old = context.Shop.FirstOrDefault(c => c.ShopCode == shop.ShopCode);
         if (old != null)
         {
             context.Attach(old);
             context.ApplyPropertyChanges("Shop", shop);
             context.SaveChanges();
         }
     }
 }