Ejemplo n.º 1
0
 public Chocolate GetChocolate(string Name)
 {
     using (AccountContext accountContext = new AccountContext())
     {
         return(accountContext.Chocolate.Where(chocolate => chocolate.Name == Name).FirstOrDefault());
     }
 }
        public static AccountEntity ValidateUser(AccountEntity account)
        {
            AccountContext database = new AccountContext();
            AccountEntity  result   = database.Account.Where(user => user.Name == account.Name && user.Password == account.Password).FirstOrDefault();

            return(result);
        }
Ejemplo n.º 3
0
 public void UpdateCategories(Categories categories)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Entry(categories).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public static List <Categories> DropDownList()
 {
     using (AccountContext accountContext = new AccountContext())
     {
         List <Categories> data = accountContext.Categories.ToList();
         return(data);
     }
 }
Ejemplo n.º 5
0
 public List <Categories> GetCategoriesDetails()
 {
     using (AccountContext accountContext = new AccountContext())
     {
         List <Categories> data = accountContext.Categories.ToList();
         return(data);
     }
 }
Ejemplo n.º 6
0
 public void AddCategories(Categories categorie)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Categories.Add(categorie);
         db.SaveChanges();
     }
 }
 public static void Signup(AccountEntity accountentity)
 {
     using (AccountContext accountContext = new AccountContext())
     {
         accountContext.Account.Add(accountentity);
         accountContext.SaveChanges();
     }
 }
Ejemplo n.º 8
0
 public void UpdateChocolate(Chocolate chocolate)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Entry(chocolate).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Ejemplo n.º 9
0
 public List <Chocolate> GetChocolateDetails()
 {
     using (AccountContext accountContext = new AccountContext())
     {
         List <Chocolate> data = accountContext.Chocolate.ToList();
         return(data);
     }
 }
Ejemplo n.º 10
0
 public void AddChocolate(Chocolate chocolates)
 {
     using (AccountContext db = new AccountContext())
     {
         db.Chocolate.Add(chocolates);
         db.SaveChanges();
     }
 }
Ejemplo n.º 11
0
 public void DeleteCategories(int id)
 {
     using (AccountContext db = new AccountContext())
     {
         Categories categories = db.Categories.Find(id);
         db.Categories.Remove(categories);
         db.SaveChanges();
     }
 }
Ejemplo n.º 12
0
 public void DeleteChocolate(string Name)
 {
     using (AccountContext db = new AccountContext())
     {
         Chocolate chocolate = db.Chocolate.Find(Name);
         db.Chocolate.Remove(chocolate);
         db.SaveChanges();
     }
 }