private void btnCategoryAdd_Click(object sender, EventArgs e)
 {
     if (txtName.Text != "")
     {
         double num;
         bool   b = double.TryParse(txtNumber.Text, out num);
         if (b)
         {
             bool c = WarehouseRepo.checkIfWarehouseExists(txtName.Text);
             if (c)
             {
                 MessageBox.Show("Warehouse already exists.");
             }
             else
             {
                 WarehouseRepo.create(Guid.NewGuid(), txtName.Text, txtAddress.Text, num, txtSubLocation.Text);
                 MessageBox.Show("Warehouse has been inserted.");
                 List <SMLIB.Entity.Warehouse> warehouse = WarehouseRepo.retrieve();
                 fillListView(warehouse);
                 clearAll();
             }
         }
         else
         {
             MessageBox.Show("Invalid contact number.");
         }
     }
     else
     {
         MessageBox.Show("Please input the warehouse name.");
     }
 }
 private void btnCategoryUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         bool b = WarehouseRepo.checkIfWarehouseExists(txtName.Text);
         if (b)
         {
             MessageBox.Show("Warehouse name already exists, please try again.");
         }
         else
         {
             double number;
             bool   c = double.TryParse(txtNumber.Text, out number);
             if (c)
             {
                 if (txtName.Text != "")
                 {
                     WarehouseRepo.update(this.id, txtName.Text, txtAddress.Text, number, txtSubLocation.Text);
                     MessageBox.Show("Warehouse has been updated.");
                     List <SMLIB.Entity.Warehouse> warehouse = WarehouseRepo.retrieve();
                     fillListView(warehouse);
                     clearAll();
                     btnCategoryUpdate.Enabled = false;
                     btnCategoryDelete.Enabled = false;
                     btnCategoryAdd.Enabled    = true;
                 }
                 else
                 {
                     MessageBox.Show("Warehouse name can not be empty.");
                 }
             }
             else
             {
                 MessageBox.Show("Invalid contact number.");
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Please select an item to update.");
     }
 }