private bool checkInsertedAssetData(List <Tuple <string, string> > assetData) { bool isError = false; try { for (int i = 0; i < assetData.Count; i++) { switch (assetData[i].Item1) { case "assetName": if (VALIDATION.isEmptyTextBox(assetData[i].Item2)) { COM_MESSAGE.validationMessage("Asset Name Cannot be Empty !!!"); isError = true; } else { if (!VALIDATION.isLetterAndNumberOnly(assetData[i].Item2)) { COM_MESSAGE.validationMessage("Asset Name should contains only Numbers and letters !!!"); isError = true; } } break; case "value": if (!VALIDATION.isEmptyTextBox(assetData[i].Item2)) { if (!VALIDATION.isDoubleValue(assetData[i].Item2)) { COM_MESSAGE.validationMessage("Value should contains only numbers !!!"); isError = true; } } break; case "quantity": if (!VALIDATION.isEmptyTextBox(assetData[i].Item2)) { if (!VALIDATION.isDoubleValue(assetData[i].Item2)) { COM_MESSAGE.validationMessage("quantity should contains only numbers !!!"); isError = true; } } break; default: break; } } } catch (Exception ex) { throw ex; } return(isError); }
private bool checkInsertedTaxData(List <Tuple <string, string> > taxData) { bool isError = false; try { for (int i = 0; i < taxData.Count; i++) { switch (taxData[i].Item1) { case "description": if (!VALIDATION.isEmptyTextBox(taxData[i].Item2)) { if (!VALIDATION.isLetterAndNumberOnly(taxData[i].Item2)) { COM_MESSAGE.validationMessage("Description should contains only Letters numbers !!!"); isError = true; } } break; case "symbol": if (VALIDATION.isEmptyTextBox(taxData[i].Item2)) { COM_MESSAGE.validationMessage("Symbol Cannot be Empty !!!"); isError = true; } if (!VALIDATION.isLetterAndNumberOnly(taxData[i].Item2)) { COM_MESSAGE.validationMessage("Symbol should contains only Letters numbers !!!"); isError = true; } break; case "taxPercentage": if (VALIDATION.isEmptyTextBox(taxData[i].Item2)) { COM_MESSAGE.validationMessage("Percentage Cannot be Empty !!!"); isError = true; } if (!VALIDATION.isDoubleValue(taxData[i].Item2)) { COM_MESSAGE.validationMessage("Percentage should contains only double values !!!"); isError = true; } break; default: break; } } } catch (Exception ex) { throw ex; } return(isError); }
private void txt_UnitPrice_Leave(object sender, EventArgs e) { try { if (!VALIDATION.isDoubleValue(txt_UnitPrice.Text)) { txt_UnitPrice.Text = string.Empty; txt_UnitPrice.Focus(); } } catch (Exception ex) { COM_MESSAGE.exceptionMessage(ex.Message); } }
private bool checkInsertedStockEntry(List <Tuple <string, string> > stockEntry) { bool isError = false; try { for (int i = 0; i < stockEntry.Count; i++) { switch (stockEntry[i].Item1) { case "quantity": if (VALIDATION.isEmptyTextBox(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Quantity Cannot be Empty !!!"); isError = true; } else { if (!VALIDATION.isDoubleValue(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Quantity is not Correct in format !!!"); isError = true; } } break; case "buyingUnitPrice": if (VALIDATION.isEmptyTextBox(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Buying Unit Price Cannot be Empty !!!"); isError = true; } else { if (!VALIDATION.isDoubleValue(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Buying Unit Price is not in Correct format !!!"); isError = true; } } break; case "sellingUnitPrice": if (VALIDATION.isEmptyTextBox(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Selling Unit Price Cannot be Empty !!!"); isError = true; } else { if (!VALIDATION.isDoubleValue(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Selling Unit Price is not in Correct format !!!"); isError = true; } } break; case "priceAfterDiscount": if (!VALIDATION.isEmptyTextBox(stockEntry[i].Item2)) { if (!VALIDATION.isDoubleValue(stockEntry[i].Item2)) { COM_MESSAGE.validationMessage("Price After Discount is not in Correct format !!!"); isError = true; } } break; default: break; } } } catch (Exception ex) { throw ex; } return(isError); }