using System; using System.Data; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Admin_EditorPage_Delete : System.Web.UI.Page { DBAccess.DBAccess DBAcc = new DBAccess.DBAccess(System.Configuration.ConfigurationSettings.AppSettings["SE_ConnectionString"]); private void Page_Load(object sender, System.EventArgs e) { } protected void f_Delete(string dbl_EPID) { #region Delete children DataSet DS = DBAcc.DataSetSel(@"SELECT [EditorPage_ID] FROM dbo.__StandardEngine_T_EditorPages where [Parent_EditorPage_ID]=" + dbl_EPID.ToString()); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { foreach (DataRow DR in DS.Tables[0].Rows) { f_Delete(DR["EditorPage_ID"].ToString()); } } #endregion // DBAcc.CommandExc(@" UPDATE [dbo].[__StandardEngine_T_EditorPages] SET [BorderMode_ID] = NULL WHERE [EditorPage_ID]=" + dbl_EPID); //Delete Prev Texts DBAcc.CommandExc(@" DELETE FROM [dbo].[__StandardEngine_T_Texts] where [EditorPage_ID]=" + dbl_EPID ); //Delete Prev Photos DBAcc.CommandExc(@" DELETE FROM [dbo].[__StandardEngine_T_Photos] where [EditorPage_ID]=" + dbl_EPID ); //Delete Prev Links DBAcc.CommandExc(@" DELETE FROM [dbo].[__StandardEngine_T_Link] where [EditorPage_ID]=" + dbl_EPID ); //Delete Prev Borders DBAcc.CommandExc(@" DELETE FROM [dbo].[__StandardEngine_T_BorderMode] where [EditorPage_ID]=" + dbl_EPID ); DBAcc.CommandExc(@" Delete from [dbo].[__StandardEngine_T_EditorPages] where EditorPage_ID=" + dbl_EPID.ToString()); } protected void Button2_Click1(object sender, EventArgs e) { f_Delete(Request.Params["EPID"].Replace("'", "")); /////////////////////////////////////////////////////////////////// Response.Redirect(Server.UrlDecode(Request.Params["retP"])); } protected void Button4_Click(object sender, EventArgs e) { Response.Redirect(Server.UrlDecode(Request.Params["retP"])); } }