Ejemplo n.º 1
0
 public Product GetProductsbyID(int ID)
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         return(context.products.Find(ID));
     }
 }
Ejemplo n.º 2
0
 public List <Product> GetProducts()
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         return(context.products.ToList());
     }
 }
Ejemplo n.º 3
0
 public List <Employee> GetAllEmployees()
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         return(context.employees.ToList());
     }
 }
Ejemplo n.º 4
0
 public void SaveProducts(Product product)
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         context.products.Add(product);
         context.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 public void SaveEmployees(Employee emp)
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         context.employees.Add(emp);
         context.SaveChanges();
     }
 }
Ejemplo n.º 6
0
 public void DeleteProduct(int id)
 {
     using (var context = new DressBazar.Database.DBazarContext())
     {
         // context.Entry(category).State = System.Data.Entity.EntityState.Modified;
         var product = context.products.Find(id);
         context.products.Remove(product);
         context.SaveChanges();
     }
 }
Ejemplo n.º 7
0
        public void UpdateProduct(Product product)
        {
            using (var context = new DressBazar.Database.DBazarContext())
            {
                context.Entry(product).State = System.Data.Entity.EntityState.Modified;

                // context.categories.Remove(product);
                context.SaveChanges();
            }
        }