public Int32 checkValues() { //Required Fields Validation Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); if (ctrlString.checkString(txtFN.Text) == 1) { isValid = 1; er2.Visible = true; } if (ctrlString.checkString(txtLN.Text) == 1) { isValid = 1; er1.Visible = true; } if (txtMN.Text != "") { if (ctrlString.checkString(txtMN.Text) == 1) { isValid = 1; er3.Visible = true; } } return isValid; }
public Int32 checkValues() { //Required Fields Validation Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); if (ctrlString.checkString(txtFN.Text) == 1) { isValid = 1; er2.Visible = true; } if (ctrlString.checkString(txtLN.Text) == 1) { isValid = 1; er1.Visible = true; } if (txtMN.Text != "") { if (ctrlString.checkString(txtMN.Text) == 1) { isValid = 1; er3.Visible = true; } } pass1 = txtPass.Text; pass2 = txtCPass.Text; if(pass1.CompareTo(pass2)==1) { MessageBox.Show("Password do not match!", "Error"); er7.Visible = true; isValid = 1; } try { Convert.ToInt32(cmbAccount.SelectedIndex); } catch (Exception) { isValid = 1; er5.Visible = true; } try { Convert.ToInt32(cmbQuestion.SelectedIndex); } catch (Exception) { isValid = 1; er5.Visible = true; } return isValid; }
public Int32 checkValues() { //Required Fields Validation Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); if (ctrlString.checkString(txtModeName.Text) == 1) { isValid = 1; er1.Visible = true; } try { Convert.ToInt32(txtDaysInterval.Text); SQLStatement con = new SQLStatement(SLS.Static.Server, SLS.Static.Database); String sql = "SELECT daysInterval FROM MODE"; SqlDataReader reader = con.executeReader(sql); while(reader.Read()) { if (SLS.Static.ID == 0) { if (Convert.ToInt32(txtDaysInterval.Text) == Convert.ToInt32(reader.GetInt32(0))) { er2.Visible = true; isValid = 1; } } else { if(daysInterval != Convert.ToInt32(txtDaysInterval.Text)) { if (Convert.ToInt32(txtDaysInterval.Text) == Convert.ToInt32(reader[0])) { er2.Visible = true; isValid = 1; } } } } } catch (Exception) { isValid = 1; er2.Visible = true; } return isValid; }
public Int32 checkValues() { Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); isValid = ctrlString.checkString(txtLoanType.Text); try { Convert.ToDecimal(txtMinAmount.Text); } catch { isValid = 1; } try { Convert.ToDecimal(txtMaxAmount.Text); } catch { isValid = 1; } try { Convert.ToInt32(txtNoOfComaker.Text); } catch { isValid = 1; } try { Convert.ToDecimal(txtEntitlement.Text); } catch { isValid = 1; } try { Convert.ToDecimal(txtEligibility.Text); } catch { isValid = 1; } try { for (int j = 0; j <= dataGridView1.Rows.Count - 1 && isValid != 1; j++) { for (int k = 2; k <= dataGridView1.Columns.Count - 1 && isValid != 1; k++) { try { Convert.ToDecimal(dataGridView1.Rows[j].Cells[k].Value.ToString()); //MessageBox.Show("" + dataGridView1.Rows[j].Cells[k].Value.ToString() + " " + j.ToString() + " " + k.ToString()); } catch { isValid = 1; } } } } catch { isValid = 1; } return isValid; }
private Int32 checkValues() { Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); isValid = ctrlString.checkString(txtMemName.Text); if (isValid == 1) { er1.Visible = true; } try { if (Convert.ToInt32(txtMinAge.Text) >= Convert.ToInt32(txtMaxAge.Text)) { er2.Visible = true; er3.Visible = true; isValid = 1; } } catch(Exception) { try { Convert.ToInt32(txtMinAge.Text); } catch (Exception) { er2.Visible = true; isValid = 1; } try { Convert.ToInt32(txtMaxAge.Text); } catch (Exception) { er3.Visible = true; isValid = 1; } } try { Convert.ToDecimal(txtFee.Text); } catch (Exception) { er4.Visible = true; isValid = 1; } if (txtShare.Text == "" && ckbLoan.Checked == false) { txtShare.Text = "0"; } else { try { Convert.ToDecimal(txtShare.Text); } catch (Exception) { er5.Visible = true; isValid = 1; } } return isValid; }
private void btnAddChild_Click(object sender, EventArgs e) { Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); isValid = ctrlString.checkString(txtCNFN.Text); isValid = ctrlString.checkString(txtCNLN.Text); if (ctrlString.checkString(txtCNFN.Text) == 1) { isValid = 1; label111.Visible = true; } if (ctrlString.checkString(txtCNLN.Text) == 1) { isValid = 1; label110.Visible = true; } try { Convert.ToInt32(cmbChildGender.SelectedIndex); } catch { isValid=1; label112.Visible = true; } if(isValid==0) { addChildren(); } else { MessageBox.Show("Some required fields are missing/invalid!", "Error"); } ClearChild(); }
//Validation of Form public Int32 checkValues() { //Required Fields Validation Int32 isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); if (ctrlString.checkString(txtFN.Text) == 1) { isValid = 1; er2.Visible = true; } if (ctrlString.checkString(txtLN.Text) == 1) { isValid = 1; er1.Visible = true; } if (ctrlString.checkString(txtCPLN.Text) == 1) { isValid = 1; label42.Visible = true; } if (ctrlString.checkString(txtCPFN.Text) == 1) { isValid = 1; label42.Visible = true; } if (txtCPMN.Text == "") { isValid = 0; } else { if (ctrlString.checkString(txtCPMN.Text) == 1) { isValid = 1; label42.Visible = true; } else { isValid = 0; } } try { Convert.ToDecimal(txtInitialCapital.Text); } catch(Exception) { isValid = 1; er7.Visible = true; } try { Convert.ToDecimal(txtZip.Text); } catch (Exception) { isValid = 1; label24.Visible = true; } try { Convert.ToDecimal(txtFee.Text); } catch (Exception) { isValid = 1; er10.Visible = true; } try { Convert.ToDecimal(txtMultiplier.Text); } catch (Exception) { isValid = 1; er8.Visible = true; } try { Convert.ToInt32(txtContact.Text); } catch (Exception) { isValid = 1; label42.Visible = true; } try { Convert.ToInt32(cmbMemberType.SelectedIndex); } catch (Exception) { isValid = 1; er4.Visible = true; } try { Convert.ToInt32(cmbGender.SelectedIndex); } catch (Exception) { isValid = 1; er5.Visible = true; } //Not Required Fields Validation if(txtMN.Text=="") { isValid = 0; } else { if (ctrlString.checkString(txtMN.Text) == 1) { isValid = 1; } else { isValid = 0; } } if (txtMonthlySalary.Text != "") { try { Convert.ToDecimal(txtMonthlySalary.Text); } catch (Exception) { isValid = 1; } } if (txtStartingCapital.Text != "") { try { Convert.ToDecimal(txtStartingCapital.Text); } catch (Exception) { isValid = 1; } } if (txtPresentCapital.Text != "") { try { Convert.ToDecimal(txtPresentCapital.Text); } catch (Exception) { isValid = 1; } } if (txtMonthlyNetIncome.Text != "") { try { Convert.ToDecimal(txtMonthlyNetIncome.Text); } catch (Exception) { isValid = 1; } } //Family Validation if(checkBox5.Checked==true) { if (ctrlString.checkString(txtFNFN.Text) == 1) { isValid = 1; label102.Visible = true; } if (ctrlString.checkString(txtFNLN.Text) == 1) { isValid = 1; label101.Visible = true; } } if (checkBox1.Checked == true) { if (ctrlString.checkString(txtMNFN.Text) == 1) { isValid = 1; label105.Visible = true; } if (ctrlString.checkString(txtMNLN.Text) == 1) { isValid = 1; label104.Visible = true; } } if (checkBox3.Checked == true) { if (ctrlString.checkString(txtSNFN.Text) == 1) { isValid = 1; label108.Visible = true; } if (ctrlString.checkString(txtSNLN.Text) == 1) { isValid = 1; label107.Visible = true; } } if(rbFullTime.Checked==true) { occup = 0; } else if (rbPartTime.Checked==true) { occup = 1; } else if(rbContractual.Checked==true) { occup = 2; } else if (rbSelfEmployed.Checked==true) { occup=3; } else if(rbRetired.Checked==true) { occup = 4; } return isValid ; }
private int checkValues() { int isValid = 0; SLS.Validate.Alpha ctrlString = new SLS.Validate.Alpha(); if (ctrlString.checkString(txtSavName.Text) == 1) { er1.Visible = true; isValid = 1; } try { Convert.ToDecimal(txtInterest.Text); } catch { er2.Visible = true; isValid = 1; } try { Convert.ToDecimal(txtInitial.Text); } catch { er3.Visible = true; isValid = 1; } if (ckbMaxWithdraw.Checked == true) { try { if(Convert.ToDecimal(txtMaxAmount.Text) == 0) { er4.Visible = true; isValid = 1; } } catch (Exception) { er4.Visible = true; isValid = 1; } } else { txtMaxAmount.Text = "0"; } try { Convert.ToDecimal(txtMainBal.Text); } catch { er6.Visible = true; isValid = 1; } try { Convert.ToDecimal(txtBalToEarn.Text); } catch { er7.Visible = true; isValid = 1; } return isValid; }