using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Admin_Strip_Style : 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"].Trim().Replace("'", "''") + @"_LayoutParam_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) { DataSet DS_Sub = new DataSet(); if (DS.Tables[0].Rows[0][Request.Params["T"].Trim().Replace("'", "''") + "_LayoutParam_ID"] != Convert.DBNull) { #region Get Data DS_Sub = ClSqlCmd.DataSetSel(@" SELECT dbo.__StandardEngine_T_LayoutParams.LayoutParam_ID, dbo.__StandardEngine_T_BorderMode.BorderMode_ID, dbo.__StandardEngine_T_BorderMode.BackColor, dbo.__StandardEngine_T_BorderMode.TopBorder_Color, dbo.__StandardEngine_T_BorderMode.RightBorder_Color, dbo.__StandardEngine_T_BorderMode.BottomBorder_Color, dbo.__StandardEngine_T_BorderMode.LeftBorder_Color, dbo.__StandardEngine_T_BorderMode.TopBorder_Style, dbo.__StandardEngine_T_BorderMode.RightBorder_Style, dbo.__StandardEngine_T_BorderMode.BottomBorder_Style, dbo.__StandardEngine_T_BorderMode.LeftBorder_Style, dbo.__StandardEngine_T_BorderMode.TopBorder_Size, dbo.__StandardEngine_T_BorderMode.RightBorder_Size, dbo.__StandardEngine_T_BorderMode.BottomBorder_Size, dbo.__StandardEngine_T_BorderMode.LeftBorder_Size, dbo.__StandardEngine_T_BorderMode.[Shadow_Padding_Top], dbo.__StandardEngine_T_BorderMode.[Shadow_Padding_Right], dbo.__StandardEngine_T_BorderMode.[Shadow_Padding_Bottom], dbo.__StandardEngine_T_BorderMode.[Shadow_Padding_Left], dbo.__StandardEngine_T_BorderMode.[Shadow_Hor], dbo.__StandardEngine_T_BorderMode.[Shadow_Vor], dbo.__StandardEngine_T_BorderMode.[Shadow_Blur], dbo.__StandardEngine_T_BorderMode.[Shadow_Color], dbo.__StandardEngine_T_BorderMode.[Curve_Radius], dbo.__StandardEngine_T_BorderMode.BackGround_ID, dbo.__StandardEngine_T_BackGround.background_color, dbo.__StandardEngine_T_BackGround.background_image, dbo.__StandardEngine_T_BackGround.background_repeat, dbo.__StandardEngine_T_BackGround.background_position_Hor, dbo.__StandardEngine_T_BackGround.background_position_Ver, dbo.__StandardEngine_T_BackGround.background_attachment, __StandardEngine_T_BorderMode_1.BorderMode_ID AS Inner_BorderMode_ID, __StandardEngine_T_BorderMode_1.Padding AS Inner_Padding, __StandardEngine_T_BorderMode_1.BackColor AS Inner_BackColor , __StandardEngine_T_BorderMode_1.TopBorder_Color AS Inner_TopBorder_Color , __StandardEngine_T_BorderMode_1.RightBorder_Color AS Inner_RightBorder_Color , __StandardEngine_T_BorderMode_1.BottomBorder_Color AS Inner_BottomBorder_Color , __StandardEngine_T_BorderMode_1.LeftBorder_Color AS Inner_LeftBorder_Color , __StandardEngine_T_BorderMode_1.TopBorder_Style AS Inner_TopBorder_Style , __StandardEngine_T_BorderMode_1.RightBorder_Style AS Inner_RightBorder_Style , __StandardEngine_T_BorderMode_1.BottomBorder_Style AS Inner_BottomBorder_Style , __StandardEngine_T_BorderMode_1.LeftBorder_Style AS Inner_LeftBorder_Style , __StandardEngine_T_BorderMode_1.TopBorder_Size AS Inner_TopBorder_Size , __StandardEngine_T_BorderMode_1.RightBorder_Size AS Inner_RightBorder_Size , __StandardEngine_T_BorderMode_1.BottomBorder_Size AS Inner_BottomBorder_Size , __StandardEngine_T_BorderMode_1.LeftBorder_Size AS Inner_LeftBorder_Size, __StandardEngine_T_BorderMode_1.[Shadow_Padding_Top] AS Inner_Shadow_Padding_Top, __StandardEngine_T_BorderMode_1.[Shadow_Padding_Right] AS Inner_Shadow_Padding_Right, __StandardEngine_T_BorderMode_1.[Shadow_Padding_Bottom] AS Inner_Shadow_Padding_Bottom, __StandardEngine_T_BorderMode_1.[Shadow_Padding_Left] AS Inner_Shadow_Padding_Left, __StandardEngine_T_BorderMode_1.[Shadow_Hor] AS Inner_Shadow_Hor, __StandardEngine_T_BorderMode_1.[Shadow_Vor] AS Inner_Shadow_Vor, __StandardEngine_T_BorderMode_1.[Shadow_Blur] AS Inner_Shadow_Blur, __StandardEngine_T_BorderMode_1.[Shadow_Color] AS Inner_Shadow_Color, __StandardEngine_T_BorderMode_1.[Curve_Radius] AS Inner_Curve_Radius FROM dbo.__StandardEngine_T_LayoutParams INNER JOIN dbo.__StandardEngine_T_BorderMode ON dbo.__StandardEngine_T_LayoutParams.Outer_BorderMode_ID = dbo.__StandardEngine_T_BorderMode.BorderMode_ID INNER JOIN dbo.__StandardEngine_T_BorderMode AS __StandardEngine_T_BorderMode_1 ON dbo.__StandardEngine_T_LayoutParams.Inner_BorderMode_ID = __StandardEngine_T_BorderMode_1.BorderMode_ID LEFT OUTER JOIN dbo.__StandardEngine_T_BackGround ON dbo.__StandardEngine_T_BorderMode.BackGround_ID = dbo.__StandardEngine_T_BackGround.BackGround_ID where dbo.__StandardEngine_T_LayoutParams.LayoutParam_ID=" + DS.Tables[0].Rows[0][Request.Params["T"].Trim().Replace("'", "''") + "_LayoutParam_ID"].ToString()); #endregion #region Set Data if (DS_Sub.Tables.Count > 0 && DS_Sub.Tables[0].Rows.Count > 0) { #region Settig Outter strip if (DS_Sub.Tables[0].Rows[0]["BackColor"] != Convert.DBNull) { txt_Outer_BackColor.Value = DS_Sub.Tables[0].Rows[0]["BackColor"].ToString(); cb_Outer_BackColor_Trans.Checked = false; } else { txt_Outer_BackColor.Value = ""; cb_Outer_BackColor_Trans.Checked = true; } if (DS_Sub.Tables[0].Rows[0]["TopBorder_Color"] != Convert.DBNull) txt_Outer_TopBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["TopBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["RightBorder_Color"] != Convert.DBNull) txt_Outer_RightBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["RightBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["BottomBorder_Color"] != Convert.DBNull) txt_Outer_BottomBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["BottomBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["LeftBorder_Color"] != Convert.DBNull) txt_Outer_LeftBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["LeftBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["TopBorder_Style"] != Convert.DBNull) ddl_Outer_TopBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["TopBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["RightBorder_Style"] != Convert.DBNull) ddl_Outer_RightBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["RightBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["BottomBorder_Style"] != Convert.DBNull) ddl_Outer_BottomBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["BottomBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["LeftBorder_Style"] != Convert.DBNull) ddl_Outer_LeftBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["LeftBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["TopBorder_Size"] != Convert.DBNull) ddl_Outer_TopBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["TopBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["RightBorder_Size"] != Convert.DBNull) ddl_Outer_RightBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["RightBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["BottomBorder_Size"] != Convert.DBNull) ddl_Outer_BottomBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["BottomBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["LeftBorder_Size"] != Convert.DBNull) ddl_Outer_LeftBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["LeftBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Top"] != Convert.DBNull) ddl_Outer_Shadow_Padding_Top.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Top"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Right"] != Convert.DBNull) ddl_Outer_Shadow_Padding_Right.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Right"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Bottom"] != Convert.DBNull) ddl_Outer_Shadow_Padding_Bottom.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Bottom"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Left"] != Convert.DBNull) ddl_Outer_Shadow_Padding_Left.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Padding_Left"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Hor"] != Convert.DBNull) { ddl_Outer_Shadow_Hor.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Hor"].ToString().Replace("-", "").Replace("+", "").Trim(); if (Convert.ToInt32(DS_Sub.Tables[0].Rows[0]["Shadow_Hor"].ToString().Replace("px", "")) < 0) { rbl_Outer_Shadow_Hor.SelectedValue = "-"; } else { rbl_Outer_Shadow_Hor.SelectedValue = ""; } } if (DS_Sub.Tables[0].Rows[0]["Shadow_Vor"] != Convert.DBNull) { ddl_Outer_Shadow_Ver.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Vor"].ToString().Replace("-","").Replace("+","").Trim(); if (Convert.ToInt32(DS_Sub.Tables[0].Rows[0]["Shadow_Vor"].ToString().Replace("px", "")) < 0) { rbl_Outer_Shadow_Ver.SelectedValue = "-"; } else { rbl_Outer_Shadow_Ver.SelectedValue = ""; } } if (DS_Sub.Tables[0].Rows[0]["Shadow_Blur"] != Convert.DBNull) ddl_Outer_Shadow_Blur.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Blur"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Shadow_Color"] != Convert.DBNull) txt_Outer_Shadow_Color.Value = DS_Sub.Tables[0].Rows[0]["Shadow_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Curve_Radius"] != Convert.DBNull) ddl_Outer_Curve_Radius.Value = DS_Sub.Tables[0].Rows[0]["Curve_Radius"].ToString(); #region Set Background Data if (DS_Sub.Tables[0].Rows[0]["BackGround_ID"] != Convert.DBNull) { if (DS_Sub.Tables[0].Rows[0]["background_image"] != Convert.DBNull && DS_Sub.Tables[0].Rows[0]["background_image"].ToString() != "") { hdn_background_image.Value = DS_Sub.Tables[0].Rows[0]["background_image"].ToString(); img_background_image.ImageUrl = "../Photos_Swfs/" + DS_Sub.Tables[0].Rows[0]["background_image"].ToString(); tr_background_image.Visible = true; } else { hdn_background_image.Value = ""; img_background_image.ImageUrl = ""; tr_background_image.Visible = false; } if (DS_Sub.Tables[0].Rows[0]["background_repeat"] != Convert.DBNull) ddl_background_repeat.Value = DS_Sub.Tables[0].Rows[0]["background_repeat"].ToString(); if (DS_Sub.Tables[0].Rows[0]["background_position_Hor"] != Convert.DBNull) ddl_background_position_Hor.Value = DS_Sub.Tables[0].Rows[0]["background_position_Hor"].ToString(); if (DS_Sub.Tables[0].Rows[0]["background_position_Ver"] != Convert.DBNull) ddl_background_position_Ver.Value = DS_Sub.Tables[0].Rows[0]["background_position_Ver"].ToString(); } #endregion #endregion #region Settig Inner strip if (DS_Sub.Tables[0].Rows[0]["Inner_BackColor"] != Convert.DBNull) { txt_Inner_BackColor.Value = DS_Sub.Tables[0].Rows[0]["Inner_BackColor"].ToString(); cb_Inner_BackColor_Trans.Checked = false; } else { txt_Inner_BackColor.Value = ""; cb_Inner_BackColor_Trans.Checked = true; } if (DS_Sub.Tables[0].Rows[0]["Inner_Padding"] != Convert.DBNull) { string[] Padding = DS_Sub.Tables[0].Rows[0]["Inner_Padding"].ToString().Split(null); ddl_Inner_Padding_Top.Value = (Padding.Length>=1 && Padding[0]!="") ? Padding[0] : ddl_Inner_Padding_Top.Value; ddl_Inner_Padding_Right.Value = (Padding.Length >= 2 && Padding[1] != "") ? Padding[1] : ddl_Inner_Padding_Right.Value; ddl_Inner_Padding_Bottom.Value = (Padding.Length >= 3 && Padding[2] != "") ? Padding[2] : ddl_Inner_Padding_Bottom.Value; ddl_Inner_Padding_Left.Value = (Padding.Length >= 4 && Padding[3] != "") ? Padding[3] : ddl_Inner_Padding_Left.Value; } if (DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Color"] != Convert.DBNull) txt_Inner_TopBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Color"] != Convert.DBNull) txt_Inner_RightBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Color"] != Convert.DBNull) txt_Inner_BottomBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Color"] != Convert.DBNull) txt_Inner_LeftBorder_Color.Value = DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Style"] != Convert.DBNull) ddl_Inner_TopBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Style"] != Convert.DBNull) ddl_Inner_RightBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Style"] != Convert.DBNull) ddl_Inner_BottomBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Style"] != Convert.DBNull) ddl_Inner_LeftBorder_Style.Value = DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Style"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Size"] != Convert.DBNull) ddl_Inner_TopBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["Inner_TopBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Size"] != Convert.DBNull) ddl_Inner_RightBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["Inner_RightBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Size"] != Convert.DBNull) ddl_Inner_BottomBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["Inner_BottomBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Size"] != Convert.DBNull) ddl_Inner_LeftBorder_Size.Value = DS_Sub.Tables[0].Rows[0]["Inner_LeftBorder_Size"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Top"] != Convert.DBNull) ddl_Inner_Shadow_Padding_Top.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Top"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Right"] != Convert.DBNull) ddl_Inner_Shadow_Padding_Right.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Right"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Bottom"] != Convert.DBNull) ddl_Inner_Shadow_Padding_Bottom.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Bottom"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Left"] != Convert.DBNull) ddl_Inner_Shadow_Padding_Left.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Padding_Left"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Hor"] != Convert.DBNull) { ddl_Inner_Shadow_Hor.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Hor"].ToString().Replace("-", "").Replace("+", "").Trim(); if (Convert.ToInt32(DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Hor"].ToString().Replace("px", "")) < 0) { rbl_Inner_Shadow_Hor.SelectedValue = "-"; } else { rbl_Inner_Shadow_Hor.SelectedValue = ""; } } if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Vor"] != Convert.DBNull) { ddl_Inner_Shadow_Ver.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Vor"].ToString().Replace("-", "").Replace("+", "").Trim(); if (Convert.ToInt32(DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Vor"].ToString().Replace("px", "")) < 0) { rbl_Inner_Shadow_Ver.SelectedValue = "-"; } else { rbl_Inner_Shadow_Ver.SelectedValue = ""; } } if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Blur"] != Convert.DBNull) ddl_Inner_Shadow_Blur.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Blur"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Color"] != Convert.DBNull) txt_Inner_Shadow_Color.Value = DS_Sub.Tables[0].Rows[0]["Inner_Shadow_Color"].ToString(); if (DS_Sub.Tables[0].Rows[0]["Inner_Curve_Radius"] != Convert.DBNull) ddl_Inner_Curve_Radius.Value = DS_Sub.Tables[0].Rows[0]["Inner_Curve_Radius"].ToString(); #endregion } #endregion } } } protected void Button1_Click(object sender, EventArgs e) { DataSet DS = ClSqlCmd.DataSetSel(@" SELECT [ModuleStyle_ID] ,[" + Request.Params["T"].Trim().Replace("'", "''") + @"_LayoutParam_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 Update in current ModuleStyles to NULL ClSqlCmd.CommandExc(@" update [dbo].[__StandardEngine_T_ModuleStyles] set [" + Request.Params["T"].Trim().Replace("'", "''") + @"_LayoutParam_ID]=NULL where [Module_ID]=" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"]); #endregion //////////////////////////////////////////////////////////////////// if (DS.Tables[0].Rows[0][Request.Params["T"].Trim().Replace("'", "''") + "_LayoutParam_ID"] != Convert.DBNull) { #region Delete Current DataSet DS_1=ClSqlCmd.DataSetSel(@" SELECT [Outer_BorderMode_ID] ,[Inner_BorderMode_ID] FROM [dbo].[__StandardEngine_T_LayoutParams] where [LayoutParam_ID]="+DS.Tables[0].Rows[0][Request.Params["T"].Trim().Replace("'", "''") + "_LayoutParam_ID"].ToString()); //////////////////////////////////////////////////////////////// ClSqlCmd.CommandExc(@" Delete FROM [dbo].[__StandardEngine_T_LayoutParams] where [LayoutParam_ID]=" + DS.Tables[0].Rows[0][Request.Params["T"].Trim().Replace("'", "''") + "_LayoutParam_ID"].ToString()); /////////////////////////////////////////////////////////////// ClSqlCmd.CommandExc(@" Delete from [dbo].[__StandardEngine_T_BorderMode] where [BorderMode_ID] =" + DS_1.Tables[0].Rows[0]["Outer_BorderMode_ID"].ToString() + @" or [BorderMode_ID] =" + DS_1.Tables[0].Rows[0]["Inner_BorderMode_ID"].ToString()); #endregion } } #region Variables string str_LayoutParam_ID = ""; string str_Outer_BorderMode_ID = ""; string str_Inner_BorderMode_ID = ""; string str_BorderMode_ID; string str_TopBorder_Size; string str_RightBorder_Size; string str_BottomBorder_Size; string str_LeftBorder_Size; string str_Padding; string str_BackColor; string str_TopBorder_Color; string str_RightBorder_Color; string str_BottomBorder_Color; string str_LeftBorder_Color; string str_TopBorder_Style; string str_RightBorder_Style; string str_BottomBorder_Style; string str_LeftBorder_Style; string str_Stroke_Style; string str_Stroke_Color; string str_Stroke_Size; string str_Shadow_Padding_Top; string str_Shadow_Padding_Right; string str_Shadow_Padding_Bottom; string str_Shadow_Padding_Left; string str_Shadow_Hor; string str_Shadow_Vor; string str_Shadow_Blur; string str_Shadow_Color; string str_Curve_Radius; string str_BackGround_ID; string str_background_color; string str_background_image; string str_background_repeat; string str_background_position_Hor; string str_background_position_Ver; #endregion //Get template style text string str_Style_Txt = System.IO.File.ReadAllText(Request.MapPath("") + "/../Templates/LayoutStrip.css"); str_Style_Txt = str_Style_Txt.Replace("", Request.Params["T"].Trim().Replace("'", "''")); #region Insert Outer_BorderMode_ID #region Deal with Prev BG File // Delete current banner file if (fil_background_image.Value != "" && img_background_image.ImageUrl != "") { try { System.IO.File.Delete(Request.MapPath("") + "\\" + img_background_image.ImageUrl); } catch { } } if (cb_background_image_Delete.Checked && img_background_image.ImageUrl != "") { try { System.IO.File.Delete(Request.MapPath("") + "\\" + img_background_image.ImageUrl); } catch { } } #endregion //Save new BG file #region Save BG File str_background_image = ""; if (fil_background_image.Value != "") { #region Upload file if (fil_background_image.Value != "") { System.Web.UI.HtmlControls.HtmlInputFile File = fil_background_image; string str_fil_PicFileName = Request.Params["T"].Trim().Replace("'", "''") + "_BGPhoto_" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"] + fil_background_image.PostedFile.FileName.Substring(fil_background_image.PostedFile.FileName.LastIndexOf(".")); File.PostedFile.SaveAs(Request.MapPath("") + "\\..\\Photos_Swfs\\" + str_fil_PicFileName); hdn_background_image.Value = "url(../Photos_Swfs/" + str_fil_PicFileName + ")"; str_background_image = "N'" + str_fil_PicFileName + "'"; } #endregion } else if (!cb_background_image_Delete.Checked && hdn_background_image.Value != "") { str_background_image = "N'" + hdn_background_image.Value + "'"; hdn_background_image.Value = "url(../Photos_Swfs/" + hdn_background_image.Value + ")"; } else { str_background_image = "NULL"; hdn_background_image.Value = "none"; } #endregion #region Insert _BackGround_ID str_BackGround_ID = ClSqlCmd.DataSetSel("select dbo.__StandardEngine_F_MaxID_BackGround()+1").Tables[0].Rows[0][0].ToString(); str_background_color = !cb_Outer_BackColor_Trans.Checked ? ("N'" + txt_Outer_BackColor.Value + "'") : "NULL"; str_background_repeat = "N'" + ddl_background_repeat.Value + "'"; str_background_position_Hor = "N'" + ddl_background_position_Hor.Value + "'"; str_background_position_Ver = "N'" + ddl_background_position_Ver.Value + "'"; ClSqlCmd.CommandExc(@" INSERT INTO [dbo].[__StandardEngine_T_BackGround] ([BackGround_ID] ,[background_color] ,[background_image] ,[background_repeat] ,[background_position_Hor] ,[background_position_Ver]) VALUES ( " + str_BackGround_ID + @", " + str_background_color + @", " + str_background_image + @", " + str_background_repeat + @", " + str_background_position_Hor + @", " + str_background_position_Ver + @" )"); #endregion str_Outer_BorderMode_ID = ClSqlCmd.DataSetSel("select dbo.__StandardEngine_F_MaxID_BorderMode()+1").Tables[0].Rows[0][0].ToString(); str_BorderMode_ID = str_Outer_BorderMode_ID; str_TopBorder_Size = "N'" + ddl_Outer_TopBorder_Size.Value + "'"; str_RightBorder_Size = "N'" + ddl_Outer_RightBorder_Size.Value + "'"; str_BottomBorder_Size = "N'" + ddl_Outer_BottomBorder_Size.Value + "'"; str_LeftBorder_Size = "N'" + ddl_Outer_LeftBorder_Size.Value + "'"; str_Padding = "NULL"; str_BackColor = !cb_Outer_BackColor_Trans.Checked? ("N'" + txt_Outer_BackColor.Value + "'"):"NULL"; str_TopBorder_Color = txt_Outer_TopBorder_Color.Value != "" ? ("N'" + txt_Outer_TopBorder_Color.Value + "'") : "NULL"; str_RightBorder_Color = txt_Outer_RightBorder_Color.Value != "" ? ("N'" + txt_Outer_RightBorder_Color.Value + "'") : "NULL"; str_BottomBorder_Color = txt_Outer_BottomBorder_Color.Value != "" ? ("N'" + txt_Outer_BottomBorder_Color.Value + "'") : "NULL"; str_LeftBorder_Color = txt_Outer_LeftBorder_Color.Value != "" ? ("N'" + txt_Outer_LeftBorder_Color.Value + "'") : "NULL"; str_TopBorder_Style = "N'" + ddl_Outer_TopBorder_Style.Value + "'"; str_RightBorder_Style = "N'" + ddl_Outer_RightBorder_Style.Value + "'"; str_BottomBorder_Style = "N'" + ddl_Outer_BottomBorder_Style.Value + "'"; str_LeftBorder_Style = "N'" + ddl_Outer_LeftBorder_Style.Value + "'"; str_Stroke_Style = "NULL"; str_Stroke_Color = "NULL"; str_Stroke_Size = "NULL"; str_Shadow_Padding_Top = "N'" + ddl_Outer_Shadow_Padding_Top.Value + "'"; str_Shadow_Padding_Right = "N'" + ddl_Outer_Shadow_Padding_Right.Value + "'"; str_Shadow_Padding_Bottom = "N'" + ddl_Outer_Shadow_Padding_Bottom.Value + "'"; str_Shadow_Padding_Left = "N'" + ddl_Outer_Shadow_Padding_Left.Value + "'"; str_Shadow_Hor = "N'" + rbl_Outer_Shadow_Hor.SelectedValue + ddl_Outer_Shadow_Hor.Value + "'"; str_Shadow_Vor = "N'" + rbl_Outer_Shadow_Ver.SelectedValue + ddl_Outer_Shadow_Ver.Value + "'"; str_Shadow_Blur = "N'" + ddl_Outer_Shadow_Blur.Value + "'"; str_Shadow_Color = "N'" + txt_Outer_Shadow_Color.Value + "'"; str_Curve_Radius = "N'" + ddl_Outer_Curve_Radius.Value + "'"; ClSqlCmd.CommandExc(@" INSERT INTO [dbo].[__StandardEngine_T_BorderMode] ([BorderMode_ID] ,[TopBorder_Size] ,[RightBorder_Size] ,[BottomBorder_Size] ,[LeftBorder_Size] ,[Padding] ,[BackColor] ,[TopBorder_Color] ,[RightBorder_Color] ,[BottomBorder_Color] ,[LeftBorder_Color] ,[TopBorder_Style] ,[RightBorder_Style] ,[BottomBorder_Style] ,[LeftBorder_Style] ,[Stroke_Style] ,[Stroke_Color] ,[Stroke_Size] ,[Shadow_Padding_Top] ,[Shadow_Padding_Right] ,[Shadow_Padding_Bottom] ,[Shadow_Padding_Left] ,[Shadow_Hor] ,[Shadow_Vor] ,[Shadow_Blur] ,[Shadow_Color] ,[Curve_Radius] ,[BackGround_ID]) VALUES ( " + str_BorderMode_ID + @", " + str_TopBorder_Size + @", " + str_RightBorder_Size + @", " + str_BottomBorder_Size + @", " + str_LeftBorder_Size + @", " + str_Padding + @", " + str_BackColor + @", " + str_TopBorder_Color + @", " + str_RightBorder_Color + @", " + str_BottomBorder_Color + @", " + str_LeftBorder_Color + @", " + str_TopBorder_Style + @", " + str_RightBorder_Style + @", " + str_BottomBorder_Style + @", " + str_LeftBorder_Style + @", " + str_Stroke_Style + @", " + str_Stroke_Color + @", " + str_Stroke_Size + @", " + str_Shadow_Padding_Top + @", " + str_Shadow_Padding_Right + @", " + str_Shadow_Padding_Bottom + @", " + str_Shadow_Padding_Left + @", " + str_Shadow_Hor + @", " + str_Shadow_Vor + @", " + str_Shadow_Blur + @", " + str_Shadow_Color + @", " + str_Curve_Radius + @", " + str_BackGround_ID + @" )"); #region Update style text str_Style_Txt = str_Style_Txt.Replace("", (!cb_Outer_BackColor_Trans.Checked? txt_Outer_BackColor.Value:"transparent")); str_Style_Txt = str_Style_Txt.Replace("", "0px"); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_TopBorder_Style.Value + " " + ddl_Outer_TopBorder_Size.Value + " " + txt_Outer_TopBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_RightBorder_Style.Value + " " + ddl_Outer_RightBorder_Size.Value + " " + txt_Outer_RightBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_BottomBorder_Style.Value + " " + ddl_Outer_BottomBorder_Size.Value + " " + txt_Outer_BottomBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_LeftBorder_Style.Value + " " + ddl_Outer_LeftBorder_Size.Value + " " + txt_Outer_LeftBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", rbl_Outer_Shadow_Hor.SelectedValue + ddl_Outer_Shadow_Hor.Value); str_Style_Txt = str_Style_Txt.Replace("", rbl_Outer_Shadow_Ver.SelectedValue + ddl_Outer_Shadow_Ver.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_Shadow_Blur.Value); str_Style_Txt = str_Style_Txt.Replace("", txt_Outer_Shadow_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_Curve_Radius.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Outer_Shadow_Padding_Top.Value + " " + ddl_Outer_Shadow_Padding_Right.Value + " " + ddl_Outer_Shadow_Padding_Bottom.Value + " " + ddl_Outer_Shadow_Padding_Left.Value); str_Style_Txt = str_Style_Txt.Replace("", hdn_background_image.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_background_repeat.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_background_position_Hor.Value+" "+ddl_background_position_Ver.Value); #endregion #endregion #region Insert Inner_BorderMode_ID str_Inner_BorderMode_ID = ClSqlCmd.DataSetSel("select dbo.__StandardEngine_F_MaxID_BorderMode()+1").Tables[0].Rows[0][0].ToString(); str_BorderMode_ID = str_Inner_BorderMode_ID; str_TopBorder_Size = "N'" + ddl_Inner_TopBorder_Size.Value + "'"; str_RightBorder_Size = "N'" + ddl_Inner_RightBorder_Size.Value + "'"; str_BottomBorder_Size = "N'" + ddl_Inner_BottomBorder_Size.Value + "'"; str_LeftBorder_Size = "N'" + ddl_Inner_LeftBorder_Size.Value + "'"; str_Padding = "N'" + ddl_Inner_Padding_Top.Value + " " + ddl_Inner_Padding_Right.Value + " " + ddl_Inner_Padding_Bottom.Value + " " + ddl_Inner_Padding_Left.Value + "'"; str_BackColor = !cb_Inner_BackColor_Trans.Checked ? ("N'" + txt_Inner_BackColor.Value + "'") : "NULL"; str_TopBorder_Color = txt_Inner_TopBorder_Color.Value != "" ? ("N'" + txt_Inner_TopBorder_Color.Value + "'") : "NULL"; str_RightBorder_Color = txt_Inner_RightBorder_Color.Value != "" ? ("N'" + txt_Inner_RightBorder_Color.Value + "'") : "NULL"; str_BottomBorder_Color = txt_Inner_BottomBorder_Color.Value != "" ? ("N'" + txt_Inner_BottomBorder_Color.Value + "'") : "NULL"; str_LeftBorder_Color = txt_Inner_LeftBorder_Color.Value != "" ? ("N'" + txt_Inner_LeftBorder_Color.Value + "'") : "NULL"; str_TopBorder_Style = "N'" + ddl_Inner_TopBorder_Style.Value + "'"; str_RightBorder_Style = "N'" + ddl_Inner_RightBorder_Style.Value + "'"; str_BottomBorder_Style = "N'" + ddl_Inner_BottomBorder_Style.Value + "'"; str_LeftBorder_Style = "N'" + ddl_Inner_LeftBorder_Style.Value + "'"; str_Stroke_Style = "NULL"; str_Stroke_Color = "NULL"; str_Stroke_Size = "NULL"; str_Shadow_Padding_Top = "N'" + ddl_Inner_Shadow_Padding_Top.Value + "'"; str_Shadow_Padding_Right = "N'" + ddl_Inner_Shadow_Padding_Right.Value + "'"; str_Shadow_Padding_Bottom = "N'" + ddl_Inner_Shadow_Padding_Bottom.Value + "'"; str_Shadow_Padding_Left = "N'" + ddl_Inner_Shadow_Padding_Left.Value + "'"; str_Shadow_Hor = "N'" + rbl_Inner_Shadow_Hor.SelectedValue + ddl_Inner_Shadow_Hor.Value + "'"; str_Shadow_Vor = "N'" + rbl_Inner_Shadow_Ver.SelectedValue + ddl_Inner_Shadow_Ver.Value + "'"; str_Shadow_Blur = "N'" + ddl_Inner_Shadow_Blur.Value + "'"; str_Shadow_Color = "N'" + txt_Inner_Shadow_Color.Value + "'"; str_Curve_Radius = "N'" + ddl_Inner_Curve_Radius.Value + "'"; ClSqlCmd.CommandExc(@" INSERT INTO [dbo].[__StandardEngine_T_BorderMode] ([BorderMode_ID] ,[TopBorder_Size] ,[RightBorder_Size] ,[BottomBorder_Size] ,[LeftBorder_Size] ,[Padding] ,[BackColor] ,[TopBorder_Color] ,[RightBorder_Color] ,[BottomBorder_Color] ,[LeftBorder_Color] ,[TopBorder_Style] ,[RightBorder_Style] ,[BottomBorder_Style] ,[LeftBorder_Style] ,[Stroke_Style] ,[Stroke_Color] ,[Stroke_Size] ,[Shadow_Padding_Top] ,[Shadow_Padding_Right] ,[Shadow_Padding_Bottom] ,[Shadow_Padding_Left] ,[Shadow_Hor] ,[Shadow_Vor] ,[Shadow_Blur] ,[Shadow_Color] ,[Curve_Radius] ) VALUES ( " + str_BorderMode_ID + @", " + str_TopBorder_Size + @", " + str_RightBorder_Size + @", " + str_BottomBorder_Size + @", " + str_LeftBorder_Size + @", " + str_Padding + @", " + str_BackColor + @", " + str_TopBorder_Color + @", " + str_RightBorder_Color + @", " + str_BottomBorder_Color + @", " + str_LeftBorder_Color + @", " + str_TopBorder_Style + @", " + str_RightBorder_Style + @", " + str_BottomBorder_Style + @", " + str_LeftBorder_Style + @", " + str_Stroke_Style + @", " + str_Stroke_Color + @", " + str_Stroke_Size + @", " + str_Shadow_Padding_Top + @", " + str_Shadow_Padding_Right + @", " + str_Shadow_Padding_Bottom + @", " + str_Shadow_Padding_Left + @", " + str_Shadow_Hor + @", " + str_Shadow_Vor + @", " + str_Shadow_Blur + @", " + str_Shadow_Color + @", " + str_Curve_Radius + @" )"); #region Update style text str_Style_Txt = str_Style_Txt.Replace("", (!cb_Inner_BackColor_Trans.Checked? txt_Inner_BackColor.Value:"transparent")); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_Padding_Top.Value + " " + ddl_Inner_Padding_Right.Value + " " + ddl_Inner_Padding_Bottom.Value + " " + ddl_Inner_Padding_Left.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_TopBorder_Style.Value + " " + ddl_Inner_TopBorder_Size.Value + " " + txt_Inner_TopBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_RightBorder_Style.Value + " " + ddl_Inner_RightBorder_Size.Value + " " + txt_Inner_RightBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_BottomBorder_Style.Value + " " + ddl_Inner_BottomBorder_Size.Value + " " + txt_Inner_BottomBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_LeftBorder_Style.Value + " " + ddl_Inner_LeftBorder_Size.Value + " " + txt_Inner_LeftBorder_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", rbl_Inner_Shadow_Hor.SelectedValue + ddl_Inner_Shadow_Hor.Value); str_Style_Txt = str_Style_Txt.Replace("", rbl_Inner_Shadow_Ver.SelectedValue + ddl_Inner_Shadow_Ver.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_Shadow_Blur.Value); str_Style_Txt = str_Style_Txt.Replace("", txt_Inner_Shadow_Color.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_Curve_Radius.Value); str_Style_Txt = str_Style_Txt.Replace("", ddl_Inner_Shadow_Padding_Top.Value + " " + ddl_Inner_Shadow_Padding_Right.Value + " " + ddl_Inner_Shadow_Padding_Bottom.Value + " " + ddl_Inner_Shadow_Padding_Left.Value); #endregion #endregion #region Insert _LayoutParams_ID str_LayoutParam_ID = ClSqlCmd.DataSetSel("select dbo.__StandardEngine_F_MaxID_LayoutParams()+1").Tables[0].Rows[0][0].ToString(); ClSqlCmd.CommandExc(@" INSERT INTO [dbo].[__StandardEngine_T_LayoutParams] ([LayoutParam_ID] ,[Outer_BorderMode_ID] ,[Inner_BorderMode_ID]) VALUES ( " + str_LayoutParam_ID + @", " + str_Outer_BorderMode_ID + @", " + str_Inner_BorderMode_ID + @" )"); #endregion #region update current ModuleStyles ClSqlCmd.CommandExc(@" update [dbo].[__StandardEngine_T_ModuleStyles] set [" + Request.Params["T"].Trim().Replace("'", "''") + @"_LayoutParam_ID]=" + str_LayoutParam_ID + @" where [Module_ID]=" + System.Configuration.ConfigurationSettings.AppSettings["SE_ModuleID"]); #endregion #region write css files System.IO.File.WriteAllText(Request.MapPath("") + "/../CSS/" + Request.Params["T"].Trim().Replace("'", "") + ".css", str_Style_Txt); #endregion /////////////////////////////////////////////////////////////////////// if (Request.Params["retP"] != null && Request.Params["retP"] != "") { Response.Redirect(Server.UrlDecode(Request.Params["retP"])); } } }