Exemplo n.º 1
0
 public static (User, bool) UserCUD(User user, EntityState entityState)
 {
     using (CariHesapDbEntities c = new CariHesapDbEntities())
     {
         c.Entry(user).State = entityState;
         if (c.SaveChanges() > 0)
         {
             return(user, true);
         }
         else
         {
             return(user, false);
         }
     }
 }
Exemplo n.º 2
0
 public static (Product, bool) ProductCUD(Product product, EntityState entityState)
 {
     using (CariHesapDbEntities c = new CariHesapDbEntities())
     {
         c.Entry(product).State = entityState;
         if (c.SaveChanges() > 0)
         {
             return(product, true);
         }
         else
         {
             return(product, false);
         }
     }
 }
Exemplo n.º 3
0
 public static (Category, bool) CategoryCUD(Category category, EntityState entityState)
 {
     using (CariHesapDbEntities c = new CariHesapDbEntities())
     {
         c.Entry(category).State = entityState;
         if (c.SaveChanges() > 0)
         {
             return(category, true);
         }
         else
         {
             return(category, false);
         }
     }
 }
Exemplo n.º 4
0
 public static (Sale, bool) SaleAdd(Sale sale)
 {
     using (CariHesapDbEntities c = new CariHesapDbEntities())
     {
         var a = c.Sale.Add(sale);
         if (c.SaveChanges() > 0)
         {
             return(a, true);
         }
         else
         {
             return(a, false);
         }
     }
 }