private void GetSearch() { ClearForm(); btnAdd.Visible = false; //hidPrimaryKey.Value = ""; string strCustNo = txtCustNo.Text; hidPrimaryKey.Value = txtCustNo.Text; string custType = "Cust"; int strCnt = 0; if ((strCustNo != "") && (strCustNo.Contains("%") == true)) { if (custType == "Cust") { if (isNumeric(strCustNo.Remove(strCustNo.Length - 1, 1), System.Globalization.NumberStyles.Integer) == false) { strCnt = Convert.ToInt16(cntCustName(strCustNo, custType)); } else { strCnt = Convert.ToInt16(cntCustNo(strCustNo, custType)); } int maxRowCount = utility.GetSQLWarningRowCount(); if (strCnt < maxRowCount) { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Customer", "LoadCustomer('" + Server.UrlEncode(PFC.SOE.Securitylayer.Cryptor.Encrypt(strCustNo)) + "','" + custType + "');", true); } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Customer", "alert('Maximum row exceeds for this search.please enter additional data.');", true); } } else { if (isNumeric(strCustNo.Remove(strCustNo.Length - 1, 1), System.Globalization.NumberStyles.Integer) == false) { strCnt = Convert.ToInt16(cntCustName(strCustNo, custType)); } else { strCnt = Convert.ToInt16(cntCustNo(strCustNo, custType)); } if (strCnt < 25) { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Vendor", "LoadCustomer('" + strCustNo + "','" + custType + "');", true); } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Vendor", "alert('Entered value is too small to retrieve the customer info.please enter additional characters');", true); } } } else { ViewState["Mode"] = "Add"; btncheck(); ClearForm(); if (hidPrimaryKey.Value != "") { BindLable(); } else { lbltype.Text = ""; lblName.Text = ""; lblAddress.Text = ""; lblCityInfo.Text = ""; lblCountry.Text = ""; lblPhone.Text = ""; tblDataEntry.Visible = false; } hidPrimaryKey.Value = strCustNo; UpdatePanels(); } }