private bool Validateform() { if (ObjUtil.IsControlTextEmpty(txtUserName)) { clsUtility.ShowInfoMessage("Enter User Name ", clsUtility.strProjectTitle); txtUserName.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtPassword)) { clsUtility.ShowInfoMessage("Enter Password ", clsUtility.strProjectTitle); txtPassword.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtVerifyPassword)) { clsUtility.ShowInfoMessage("Enter Verify Password ", clsUtility.strProjectTitle); txtVerifyPassword.Focus(); return(false); } else if (txtPassword.Text.Trim() != txtVerifyPassword.Text.Trim()) { clsUtility.ShowInfoMessage("Password and Verify Password must be Same ", clsUtility.strProjectTitle); txtVerifyPassword.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtEmail)) { clsUtility.ShowInfoMessage("Enter E-Mail Address ", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } else if (!ObjUtil.ValidateEmail(txtEmail.Text)) { clsUtility.ShowInfoMessage("Enter Valid E-Mail Address.", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(cmbSecurity)) { clsUtility.ShowInfoMessage("Select Security question for password retrival.", clsUtility.strProjectTitle); cmbSecurity.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtAsnwer)) { clsUtility.ShowInfoMessage("Enter Security's question.", clsUtility.strProjectTitle); txtAsnwer.Focus(); return(false); } else if (rdAdmin.Checked == false && rdLimitedUser.Checked == false) { clsUtility.ShowInfoMessage("Select Account Type ", clsUtility.strProjectTitle); grpAccount.Focus(); return(false); } return(true); }
private bool Validation() { txtEncKey.Clear(); if (Obj.IsControlTextEmpty(txtCustomerName)) { clsUtility.ShowInfoMessage("Enter Customer Name ", clsUtility.strProjectTitle); txtCustomerName.Focus(); return(false); } else if (Obj.IsControlTextEmpty(txtProductName)) { clsUtility.ShowInfoMessage("Enter Product Name ", clsUtility.strProjectTitle); txtProductName.Focus(); return(false); } else if (Obj.IsControlTextEmpty(txtOrganisation)) { clsUtility.ShowInfoMessage("Enter Organisation Name ", clsUtility.strProjectTitle); txtOrganisation.Focus(); return(false); } else if (Obj.IsControlTextEmpty(txtMobileNo)) { clsUtility.ShowInfoMessage("Enter Mobile Number ", clsUtility.strProjectTitle); txtMobileNo.Focus(); return(false); } else if (Obj.IsControlTextEmpty(txtEmail)) { clsUtility.ShowInfoMessage("Enter Email Address ", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } else if (Obj.IsControlTextEmpty(txtAddress)) { clsUtility.ShowInfoMessage("Enter Address ", clsUtility.strProjectTitle); txtAddress.Focus(); return(false); } else { if (Obj.ValidateEmail(txtEmail.Text)) { if (txtMobileNo.Text.Trim().Length >= 10 && txtEmail.Text.Trim().Length >= 10) { return(true); } else { clsUtility.ShowErrorMessage("Enter Mobile Number or Email Address", clsUtility.strProjectTitle); txtMobileNo.Focus(); return(false); } } else { clsUtility.ShowErrorMessage("Enter Valid Email Address ", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } } }
private bool FormValidation() { string ValidatingEmailID = txtEmail.Text.Trim(); if (ObjUtil.IsControlTextEmpty(txtUserName)) { clsUtility.ShowInfoMessage("Enter UserName.", clsUtility.strProjectTitle); txtUserName.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtEmail)) { clsUtility.ShowInfoMessage("Enter E-Mail Address.", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } else if (!ObjUtil.ValidateEmail(ValidatingEmailID)) { clsUtility.ShowInfoMessage("Enter Valid E-Mail Address.", clsUtility.strProjectTitle); txtEmail.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(cmbSecurity)) { clsUtility.ShowInfoMessage("Select Security question for password retrival.", clsUtility.strProjectTitle); cmbSecurity.Focus(); return(false); } else if (ObjUtil.IsControlTextEmpty(txtAsnwer)) { clsUtility.ShowInfoMessage("Enter Security's question.", clsUtility.strProjectTitle); txtAsnwer.Focus(); return(false); } else { dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "[UserName],[SecurityQuestion],[Answer],[Password],EmailID", "UserName='******'", null); if (ObjUtil.ValidateTable(dt)) { string SecurityQuestion, Answer, Password, EmailID; SecurityQuestion = dt.Rows[0]["SecurityQuestion"].ToString(); Answer = ObjUtil.Decrypt(dt.Rows[0]["Answer"].ToString(), true); Password = dt.Rows[0]["Password"].ToString(); EmailID = dt.Rows[0]["EmailID"].ToString(); if (SecurityQuestion == cmbSecurity.SelectedItem.ToString() && Answer.ToLower() == txtAsnwer.Text.ToLower() && EmailID.ToLower() == txtEmail.Text.ToLower()) { txtRetrivePassword.Text = ObjUtil.Decrypt(Password, true); } else { clsUtility.ShowInfoMessage("Entered details is not matching.", clsUtility.strProjectTitle); return(false); } } else { clsUtility.ShowInfoMessage("Entered UserName or EmailID is not exist.", clsUtility.strProjectTitle); return(false); } return(true); } }