public static List <ProductsMoving> GetAllProductsMovingFromEntity()
 {
     using (var db = new Shop_2Entities())
     {
         return(db.ProductsMoving.ToList());
     }
 }
 public static void DeleteUserRolesToEntity(int id)
 {
     using (var db = new Shop_2Entities())
     {
         db.UserRoles.Remove(db.UserRoles.First(it => it.id == id));
         db.SaveChanges();
     }
 }
 public static void UpdateUserRolesToEntity(UserRoles userRoles)
 {
     using (var db = new Shop_2Entities())
     {
         db.UserRoles.First(it => it.id == userRoles.id).Role = userRoles.Role;
         db.SaveChanges();
     }
 }
 public static void DeleteProductsMovingToEntity(int id)
 {
     using (var db = new Shop_2Entities())
     {
         db.ProductsMoving.Remove(db.ProductsMoving.First(it => it.id == id));
         db.SaveChanges();
     }
 }
 public static void UpdateUsersToEntity(Users users)
 {
     using (var db = new Shop_2Entities())
     {
         var newusers = db.Users.First(it => it.id == users.id);
         newusers.Login     = users.Login;
         newusers.Passwword = users.Passwword;
         newusers.idRole    = users.idRole;
         db.SaveChanges();
     }
 }