protected void btnRework_Click(object sender, EventArgs e) { if (Request.QueryString["FBMREQUESTID"] == null) { int retval = BLL_FBM_Report.FBMMessageRework(Convert.ToInt32(Request.QueryString["FBMID"].ToString()), "REWORK"); SendEmailForRework(Convert.ToInt32(Request.QueryString["FBMID"].ToString()), Convert.ToInt32(ViewState["FBM_CREATED_BY"].ToString()) , Convert.ToInt32(Session["userid"].ToString())); String script = String.Format("alert('FBM has been send for Rework.');window.opener.location.reload(true);window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", script, true); } else { int retval = BLL_FBM_Report.FBMMessageRework(Convert.ToInt32(Request.QueryString["FBMREQUESTID"].ToString()), "REWORK"); SendEmailForRework(Convert.ToInt32(Request.QueryString["FBMREQUESTID"].ToString()), Convert.ToInt32(Request.QueryString["REQUESTERID"].ToString()) , Convert.ToInt32(Request.QueryString["APPROVARID"].ToString())); String script = String.Format("alert('FBM has been send for Rework.');window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", script, true); } }