private int ValidateEntries() { int errors = 0; string checkSKU = "select SKU from tblProductData WHERE SKU =@param"; if (DatabaseAssist.CheckIfItemExists(checkSKU, TxtSKU.Text) == true) { picErrorSKU.Visible = true; new ToolTip().SetToolTip(picErrorSKU, "SKU Already Exists, Please Try Another - The next aviable is : " + DatabaseAssist.GetLastSKU().ToString()); errors++; } else { picErrorSKU.Visible = false; } if (Helper.CheckTextBoxForString(TxtDescription.Text) == "empty") { picErrorDescription.Visible = true; new ToolTip().SetToolTip(picErrorDescription, "Field Cannot Be Empty"); errors++; } else { picErrorDescription.Visible = false; } if (Helper.CheckTextBoxForString(TxtCost.Text) != "number") { picErrorCost.Visible = true; new ToolTip().SetToolTip(picErrorCost, "Please enter a number"); errors++; } else { picErrorCost.Visible = false; } if (Helper.CheckTextBoxForString(TxtPrice.Text) != "number") { picErrorPrice.Visible = true; new ToolTip().SetToolTip(picErrorPrice, "Please enter a number"); errors++; } else { picErrorPrice.Visible = false; } if (Helper.CheckTextBoxForString(TxtPicPath.Text) == "empty") { lblAddImage.Visible = true; errors++; } else { lblAddImage.Visible = false; } return(errors); }