Exemplo n.º 1
0
        public void Save(string cashierName, int productId, string productName, double price, int beforeQty, int soldQty)
        {
            Transaction trans = new Transaction
            {
                TimeStamp   = DateTime.Now,
                ProductId   = productId,
                ProductName = productName,
                Price       = price,
                BeforeQty   = beforeQty,
                SoldQty     = soldQty,
                CashierName = cashierName,
            };

            _db.Transactions.Add(trans);
            _db.SaveChanges();
        }
Exemplo n.º 2
0
 public void AddProduct(Product product)
 {
     _db.Products.Add(product);
     _db.SaveChanges();
 }
Exemplo n.º 3
0
 public void AddCategory(Category category)
 {
     _db.Categories.Add(category);
     _db.SaveChanges();
 }