protected void ImgFBMAttDelete_Click(object sender, CommandEventArgs e) { string[] cmdargs = e.CommandArgument.ToString().Split(','); string fileid = cmdargs[0].ToString(); string fileName = cmdargs[1].ToString(); string filepath = "../../uploads/fbm/" + fileName; int retval = BLL_FBM_Report.FBMAttachmentDelete(Convert.ToInt32(Session["userid"].ToString()), Convert.ToInt32(fileid)); if (File.Exists(Server.MapPath(filepath))) { File.Delete(Server.MapPath(filepath)); } if (Request.QueryString["FBMID"] != null) { BindFBMAttachment(Convert.ToInt32(Request.QueryString["FBMID"].ToString())); } if (Request.QueryString["FBMREQUESTID"] != null) { BindFBMAttachment(Convert.ToInt32(Request.QueryString["FBMID"].ToString())); } }
protected void gvFBMAtt_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToUpper().Equals("DELETE")) { GridView _gridView = (GridView)sender; int nCurrentRow = Int32.Parse(e.CommandArgument.ToString()); string fbmattid = ((Label)gvFBMAtt.Rows[nCurrentRow].FindControl("lblFileId")).Text; if (fbmattid.ToString() == "") { DataTable dt = (DataTable)ViewState["TempDtLocation"]; dt.Rows[nCurrentRow].Delete(); dt.AcceptChanges(); } else { int retval = BLL_FBM_Report.FBMAttachmentDelete(Convert.ToInt32(Session["userid"].ToString()), Convert.ToInt32(fbmattid)); } } }