/*fill up the website with items */
 public void stockStore()
 {
     try
     {
         lblError.Visible = false;
         foreach (Record_Product item in Functions_Product.getProduct())
         {
             mainStore.Text += (Functions_Product.displayProducts(
                                    item.Title
                                    , item.Description
                                    , item.Quantity
                                    , item.Cost
                                    , item.PicturePath));
         }
     }
     catch (Exception ex)
     {
         lblError.Visible = true;
         lblError.Text    = "No products are available to display at this time.";
         Debug.WriteLine
             ("******ALERT*****\n" +
             $"{ex}\n" +
             "******ENDALERT*****\n");
     }
 }
Ejemplo n.º 2
0
 /* this function combines the product list with the HTML to turn it into a table */
 public void fillTable()
 {
     {
         productTable.Text = @"
     <div class = 'container'>
         <thead>
             <tr>
                 <th scope = 'col'>ID</th>
                 <th scope = 'col'>Title</th>
                 <th scope = 'col'>Description</th>
                 <th scope = 'col'>Quantity</th>
                 <th scope = 'col'>Cost</th>
                 <th scope = 'col'>Picture Path</th>
             </tr>
         </thead>
         <tbody>";
         try
         {
             foreach (Record_Product item in Functions_Product.getProduct())
             {
                 productTable.Text += (Functions_Product.tableProducts(
                                           item.productID
                                           , item.Title
                                           , item.Description
                                           , item.Quantity
                                           , item.Cost
                                           , item.PicturePath));
             }
             productTable.Text += "</tbody></div>";
         }
         catch (Exception ex)
         {
             globalMethods.printDebug(
                 ("******ALERT*****\n" +
                  $"{ex}\n" +
                  "******ENDALERT*****\n"));
         }
     }
 }