protected string CleanSearchTerms(string s) { Regex r = new Regex(@"\s+"); string l_key = r.Replace(s, " "); l_key = PubEntAdminManager.Clean(l_key); l_key = PubEntAdminManager.StripOutNoise(l_key); return(l_key); }
protected void btnAdd_Click(object sender, EventArgs e) { lblMessage.Text = ""; lblMessage2.Text = ""; txtAddress.Text = PubEntAdminManager.Clean(txtAddress.Text); txtZip.Text = PubEntAdminManager.Clean(txtZip.Text); txtZip.Text = txtZip.Text.ToString().PadLeft(5, '0'); txtIPAddress.Text = PubEntAdminManager.Clean(txtIPAddress.Text); if (txtIPAddress.Text.Trim().Length > 0) { if (DAL.PE_DAL.AddDNMRecord("", "", txtIPAddress.Text) == false) { lblMessage.Text = "Unable to save IP Address"; } else { lblMessage.Text = "IP Address added successfully"; txtIPAddress.Text = txtAddress.Text = txtZip.Text = ""; } } else if (txtAddress.Text.Trim().Length > 0 && txtZip.Text.Trim().Length > 0) { if (DAL.PE_DAL.AddDNMRecord(txtAddress.Text, txtZip.Text, "") == false) { lblMessage.Text = "Unable to save IP Address"; } else { lblMessage.Text = "Mailing Address added successfully"; txtIPAddress.Text = txtAddress.Text = txtZip.Text = ""; } } else { lblMessage.Text = "Mailing -or- IP Address required"; } Bindgrid(""); }