public void DeleteSOP(DeleteSOPRequest argObj) { try { AdminDAL ws = new AdminDAL(); ws.DeleteSOPUser(argObj); } catch (Exception ex) { } }
private void DeleteSOP(string argSOPId) { log4net.ILog logger = log4net.LogManager.GetLogger("File"); try { if (!string.IsNullOrEmpty(argSOPId)) { AdminBLL ws = new AdminBLL(); AdminDAL w = new AdminDAL(); SqlConnection conn = new SqlConnection(); conn = w.getconnection(); DeleteSOPRequest _req = new DeleteSOPRequest(); _req.SOP_ID = argSOPId.ToString(); string id = argSOPId.ToString(); string query = "select top 1 ImagePathName from SOP_Master name where SOP_ID='" + id + "'"; SqlCommand cmd = new SqlCommand(query, conn); SqlDataReader rd = cmd.ExecuteReader(); string s = string.Empty; while (rd.Read()) { s = rd.GetValue(0).ToString(); } FileInfo TheFile = new FileInfo(MapPath("../Images/") + "\\" + s); if (TheFile.Exists) { File.Delete(MapPath("../Images/") + "\\" + s); } ws.DeleteSOP(_req); // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "AlertMessage", " alert('Record Deleted SuccessFully');", true); HttpContext.Current.Items.Add(ContextKeys.CTX_COMPLETE, "DELETE"); BindGrid(); ModalPopupDelete.Hide(); //========================// rd.Close(); rd.Dispose(); //========================// //Server.Transfer("AlertUpdateComplete.aspx"); } } catch (Exception ex) { logger.Info(ex.Message); } }
private void DeleteSOP(string argSOPId) { log4net.ILog logger = log4net.LogManager.GetLogger("File"); try { if (!string.IsNullOrEmpty(argSOPId)) { AdminBLL ws = new AdminBLL(); AdminDAL w = new AdminDAL(); SqlConnection conn = new SqlConnection(); conn = w.getconnection(); DeleteSOPRequest _req = new DeleteSOPRequest(); _req.SOP_ID = argSOPId.ToString(); string id = argSOPId.ToString(); string query = "select top 1 ImagePathName from SOP_Master name where SOP_ID='" + id + "'"; SqlCommand cmd = new SqlCommand(query, conn); SqlDataReader rd = cmd.ExecuteReader(); string s = string.Empty; while (rd.Read()) { s = rd.GetValue(0).ToString(); } FileInfo TheFile = new FileInfo(MapPath("../FileUpload/") + "\\" + s); if (TheFile.Exists) { File.Delete(MapPath("../FileUpload/") + "\\" + s); } ws.DeleteSOP(_req); // HttpContext.Current.Items.Add(ContextKeys.CTX_COMPLETE, "DELETE"); // Server.Transfer("AlertUpdateComplete.aspx"); BindGridWithFilter(); } } catch (Exception ex) { logger.Info(ex.Message); } }