private Boolean isValidFeilds() { foreach (Control control in gb_details.Controls) { if (control is TextBox) { if (control.Text == "") { return(false); } } } if (!Validation.isPhoneNumber(txt_Phone.Text)) { return(false); } if (!Validation.isValidNIC(txt_NIC.Text)) { return(false); } if (!Validation.isStringWithoutNumbers(txt_Type.Text) && /*!Validation.isStringWithoutNumbers(txt_Address.Text) && */ !Validation.isStringWithoutNumbers(txt_CusName.Text)) { return(false); } return(true); }
private Boolean ValidateForm() { if (!Validation.isStringWithoutNumbers(txtUserName.Text)) { return(false); } if (txtPW.Text != txtConfirm.Text) { return(false); } if (txtConfirm.Text == "" || txtPW.Text == "" || txtUserID.Text == "" || txtUserName.Text == "") { return(false); } return(true); }
//public void ButtonSave() { // MessageBox.Show(Validation.isStringWithoutNumbers("hel3lo").ToString()); //} /// <summary> /// Validate fields in frm_Projects check if they are all in prefered format, if it is /// return true, else return false. /// </summary> /// <returns></returns> public Boolean ValidateFields() { // Validate Project Basic Details // + Land Info foreach (Control control in landInfo_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + Profile Info, no Validations for the date since we get it from dtp foreach (Control control in profileInfo_gb.Controls) { if (control is TextBox) { if (!Validation.isStringWithoutNumbers(control.Text)) { return(false); } } } // + cost of purchase foreach (Control control in costOfPurchase_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + survey charges foreach (Control control in surveyCharges_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + develpoment foreach (Control control in development_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + utilities foreach (Control control in utilities_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + travelling foreach (Control control in travelling_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // + advertising foreach (Control control in advertising_gb.Controls) { if (control is TextBox) { if (!Validation.isNumber(control.Text)) { return(false); } } } // cost, sales and profitability part should be validated. return(true); }