Exemplo n.º 1
0
 public void AddCategories(Categories categorie)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Categories.Add(categorie);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void UpdateCategories(Categories categories)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Entry(categories).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
 public static void Signup(AccountEntity accountentity)
 {
     using (AccountContext accountContext = new AccountContext())
     {
         accountContext.Account.Add(accountentity);
         accountContext.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void UpdateChocolate(Chocolate chocolate)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Entry(chocolate).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void AddChocolate(Chocolate chocolates)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Chocolate.Add(chocolates);
         db.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void DeleteCategories(int id)
 {
     using (AccountContext db = new AccountContext())
     {
         Categories categories = db.Categories.Find(id);
         db.Categories.Remove(categories);
         db.SaveChanges();
     }
 }
Exemplo n.º 7
0
 public void DeleteChocolate(string Name)
 {
     using (AccountContext db = new AccountContext())
     {
         Chocolate chocolate = db.Chocolate.Find(Name);
         db.Chocolate.Remove(chocolate);
         db.SaveChanges();
     }
 }