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_Text : System.Web.UI.Page { DBAccess.DBAccess ClSqlCmd; public void Page_Load(object sender, EventArgs e) { ClSqlCmd = new DBAccess.DBAccess(System.Configuration.ConfigurationSettings.AppSettings["SE_ConnectionString"]); /////////////////////////////////////////////////////////////////////////// if (!Page.IsPostBack) { GetData(); } } void GetData() { DataSet DS = ClSqlCmd.DataSetSel(@" SELECT [ModuleStyle_ID] ,["+Request.Params["T"].Replace("'","").Trim()+@"Text] FROM [dbo].[__StandardEngine_T_ModuleStyles] where [Module_ID]=" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"]); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { if (DS.Tables[0].Rows[0][Request.Params["T"].Replace("'","").Trim()+"Text"] != Convert.DBNull) { txt_FooterText.InnerHtml = DS.Tables[0].Rows[0][Request.Params["T"].Replace("'", "").Trim() + @"Text"].ToString(); } } } protected void Button1_Click(object sender, EventArgs e) { DataSet DS = ClSqlCmd.DataSetSel(@" SELECT [ModuleStyle_ID] FROM [dbo].[__StandardEngine_T_ModuleStyles] where [Module_ID]=" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"]); if (DS.Tables.Count < 0 || DS.Tables[0].Rows.Count <= 0) { #region Insert New ModuleStyles ClSqlCmd.CommandExc(@" Insert into [dbo].[__StandardEngine_T_ModuleStyles] ( [ModuleStyle_ID] ,[Module_ID] ) values ( dbo.__StandardEngine_F_MaxID_ModuleStyles()+1 ," + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"] + @" )"); #endregion } else { } #region Variables string str_FooterText; #endregion #region update current ModuleStyles str_FooterText = txt_FooterText.Value.Trim() != "" ? ("N'" + txt_FooterText.Value.Replace("'", "''") + "'") : "NULL"; ClSqlCmd.CommandExc(@" update [dbo].[__StandardEngine_T_ModuleStyles] set [" + Request.Params["T"].Replace("'", "").Trim() + @"Text]=" + str_FooterText + @" where [Module_ID]=" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"]); #endregion /////////////////////////////////////////////////////////////////////// if (Request.Params["retP"] != null && Request.Params["retP"] != "") { Response.Redirect(Server.UrlDecode(Request.Params["retP"])); } } }