Esempio n. 1
0
        public async void addProduct(string productName, string manufacturer, Category category, double price, string description = "", int quantity = 0)
        {
            var newProduct = new Product();

            newProduct.Title        = productName;
            newProduct.Manufacturer = manufacturer;
            newProduct.Quantity     = quantity;
            newProduct.Description  = description;
            newProduct.Category     = category;
            newProduct.UPC          = System.Guid.NewGuid().ToString();
            newProduct.LastRecieved = DateTime.Now;
            newProduct.Price        = price;
            this.DbContext.Products.Add(newProduct);
            await this.DbContext.SaveChangesAsync();

            FormNavigator.CloseForm("addProductForm");
        }
Esempio n. 2
0
 private void cancelButton_Click(object sender, EventArgs e)
 {
     FormNavigator.CloseForm(this);
 }