protected void btnDraft_Click(object sender, EventArgs e) { try { if (txtMailBody.Text.Trim() != "") { int fbmidout = 0; int?fbmid = null; if (Request.QueryString["FBMID"] != null) { fbmid = Convert.ToInt32(Request.QueryString["FBMID"].ToString()); } int retval = BLL_FBM_Report.FBMMessageSave(fbmid, Convert.ToInt32(Session["userid"].ToString()), txtSubject.Text , UDFLib.ConvertIntegerToNull(DDLOfficeDept.SelectedValue), optForUser.SelectedValue.ToString().Trim() , txtMailBody.Text, 0, 1, UDFLib.ConvertIntegerToNull(DDLPrimaryCategory.SelectedValue) , UDFLib.ConvertIntegerToNull(DDLSecondryCategory.SelectedValue) , Convert.ToInt32(optPriority.SelectedValue), "DRAFT", ref fbmidout); SaveFBMAttachment(fbmidout, false); if (Request.QueryString["FBMID"] != null) { BindFBMAttachment(Convert.ToInt32(Request.QueryString["FBMID"].ToString())); } String script = String.Format("alert('FBM has been Save as Draft.');window.opener.location.reload(true);window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", script, true); } else { String script = String.Format("alert('e-Mail Body is required.')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "bodymsgdraft", script, true); } } catch (Exception ex) { } }