public void savedlogic() { try { if (CheckDouble(txtBranchName.Text) == "false") { lblcheckDoubleError.Text = String.Empty; int a = Convert.ToInt32(Session["company_id"]); int b = Int32.Parse(ddlcountry.SelectedValue); int c = Int32.Parse(ddlState.SelectedValue); string name = Convert.ToString(Session["username"]); context.sp_InsertBranch(a, txtBranchName.Text, txtAddress.Text, txtpincode.Text, txtFaxno.Text, txttelephoneno.Text, b, c, txtCity.Text, name, DateTime.Now); divalert.Visible = true; lblAlert.Text = "Branch Saved Successfully "; clr(); grdbind(); } else { divalert.Visible = false; lblcheckDoubleError.ForeColor = System.Drawing.Color.Red; lblcheckDoubleError.Text = "This Branch name is already Exists"; return; } } catch (Exception ex) { ErrorLog.saveerror(ex); } }