Exemplo n.º 1
0
 public static ProductDA getInstance()
 {
     if (instance == null)
     {
         instance = new ProductDA();
     }
     return(instance);
 }
Exemplo n.º 2
0
        public void viewProductData(int productID)
        {
            modelProduct = ProductDA.getInstance().readFromDatabase(productID);

            if (modelProduct != null)
            {
                viewProduct.ProductSalesName.Text = modelProduct.ProductName;
                viewProduct.ProductCategory.Text  = modelProduct.ProductCategory;
                viewProduct.InitialPrice.Text     = modelProduct.InitialPrice.ToString();
                viewProduct.ProductDetails.Text   = modelProduct.ProductDetails;
            }
            else
            {
                //MessageBox.Show("No Product with ID " + this.selectedProductID);
                //this.Close();
            }
        }
Exemplo n.º 3
0
 public bool update()
 {
     return(ProductDA.getInstance().updateToDatabase(this));
 }
Exemplo n.º 4
0
 public bool create()
 {
     return(ProductDA.getInstance().addToDatabase(this));
 }