コード例 #1
0
 public static List <ProductsMoving> GetAllProductsMovingFromEntity()
 {
     using (var db = new Shop_2Entities())
     {
         return(db.ProductsMoving.ToList());
     }
 }
コード例 #2
0
 public static void DeleteUserRolesToEntity(int id)
 {
     using (var db = new Shop_2Entities())
     {
         db.UserRoles.Remove(db.UserRoles.First(it => it.id == id));
         db.SaveChanges();
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 public static void DeleteProductsMovingToEntity(int id)
 {
     using (var db = new Shop_2Entities())
     {
         db.ProductsMoving.Remove(db.ProductsMoving.First(it => it.id == id));
         db.SaveChanges();
     }
 }
コード例 #5
0
 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();
     }
 }