protected void btnDelete_Click(object sender, EventArgs e) { bool res = false; try { advisorBranchVo = (AdvisorBranchVo)Session["advisorBranchVo"]; res = advisorBranchBo.DeleteBranch(advisorBranchVo.BranchId); if (res) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewBranches','none');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "alert('Sorry... Branch is not deleted...');", true); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "ViewBranchDetails.ascx.cs:btnDelete_Click()"); object[] objects = new object[2]; objects[0] = res; objects[1] = advisorBranchVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }