/*
'' ============================================================================================
'' 项目名称：{fyp_title}
'' 项目版本：{fyp_version}
'' 项目描述：{fyp_description}
'' 文件名称：{file_add_name}
'' 文件描述：信息增改文件{value_match_check value1="{table_description}" value2="" extend_match="unequal"} （{table_description}）{/value_match_check}
'' 公司名称：{fyp_company}
'' 开发人员：{fyp_designer}
'' 创建日期：{fyp_created_date}
'' 修订日期：{system_date_time format="yyyy-MM-dd hh:mm:ss"}
'' 版权信息：{fyp_copyright}

'' 项目升级时需读取以下生成工具的版权信息
'' 生成工具：{fysoft_name}
'' 当前版本：{fysoft_version}
'' 官方网站：{fysoft_website}
'' ============================================================================================
*/

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;
using FypSystem.Common;
using FypSystem.DBManager;

namespace {fyp_namespace}.Web
{
    public partial class {file_add_name type="2"} : System.Web.UI.Page
    {
        /// <summary>
        /// 当前页面是否编辑状态
        /// </summary>
        private bool bIsEdit = false;
        {fields_loop type="3" distinct="true"}
        {field_code_datatype_name code="cs" type="3" compatible="false"} req_{field_source_name}; {/fields_loop}
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = WebPage.GetConfig("fypWebName");
            if ({fields_loop type="3" separator=" && " distinct="true"}!StringExtend.IsEmpty(this.Request.QueryString["{control_name}"]){/fields_loop})
            {
            {fields_loop type="3" distinct="true"}
                {remark}非字符串参数，转换类型{/remark}
                {value_match_check value1='{field_code_datatype_name code="cs" type="3" compatible="false"}' value2="string" extend_match="unequal"}
                req_{field_source_name} = {field_code_datatype_name code="cs" type="3" compatible="false"}.Parse(this.Request.QueryString["{control_name}"]);
                {/value_match_check}

                {remark}字符串参数，直接使用{/remark}
                {value_match_check value1='{field_code_datatype_name code="cs" type="3" compatible="false"}' value2="string" extend_match="equal"}
                req_{field_source_name} = this.Request.QueryString["{control_name}"];
                {/value_match_check}
            {/fields_loop}
                bIsEdit = true;
            }

            if (!this.Page.IsPostBack)
            {
                Initialize();
            }
        }

        /// <summary>
        /// 编辑记录时，读取数据库指定记录
        /// </summary>
        /// <returns></returns>
        private {fyp_namespace}.Model.Model_{table_source_name} GetModelData()
        {
            {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name} = new {fyp_namespace}.Model.Model_{table_source_name}();
            if (bIsEdit)
                model_{table_source_name} = new {fyp_namespace}.BLL.BLL_{table_source_name}().GetModel({fields_loop type="3" separator=", "}req_{field_source_name}{/fields_loop});

            return model_{table_source_name};
        }

        /// <summary>
        /// 导入默认值、数据
        /// </summary>
        private void Initialize()
        {
            //绑定属性
            {fields_loop}
            {control_style_check value="日时选择" match="true"}
            this.{control_name}.Attributes.Add("onFocus", "WdatePicker({dateFmt:'yyyy-MM-dd H:mm:ss'})");
            {/control_style_check}
            {control_style_check value="日期选择" match="true"}
            this.{control_name}.Attributes.Add("onFocus", "WdatePicker({dateFmt:'yyyy-MM-dd'})");
            {/control_style_check}
            {control_style_check value="时分秒框" match="true"}
            this.{control_name}.Attributes.Add("onFocus", "WdatePicker({dateFmt:'H:mm:ss'})");
            {/control_style_check}
            {control_style_check value="时分框" match="true"}
            this.{control_name}.Attributes.Add("onFocus", "WdatePicker({dateFmt:'H:mm'})");
            {/control_style_check}
            {/fields_loop}

            //默认值
            {fields_loop}
            {control_style_check value="时分秒框" match="true"}
            this.{control_name}.Text = DateTime.Now.ToString("H:mm:ss");
            {/control_style_check}
            {control_style_check value="时分框" match="true"}
            this.{control_name}.Text = DateTime.Now.ToString("H:mm");
            {/control_style_check}
            {control_style_check value="日时选择" match="true"}
            this.{control_name}.Text = DateTime.Now.ToString();
            {/control_style_check}
            {control_style_check value="日期选择" match="true"}
            this.{control_name}.Text = DateTime.Now.ToString("yyyy-MM-dd");
            {/control_style_check}
            {/fields_loop}

{field_seltable_name_all_check value="不链接表" match="false"}
            //直接填充下拉框
            FypSystem.DBManager.FillCtrlData fillCtrlData = new FillCtrlData();
    {fields_loop}
        {field_seltable_name_check value="不链接表" match="false"}
            {remark note="说明："}当前字段是级联下拉框的第一级，或不是级联下拉框时，不需判断where条件{/remark}
            {field_seltable_level_check value="0|1" match="true"}
            {remark note="说明："}生成关联表的三层文件{/remark}
            {create_file table="{field_seltable_name}" fields="*" temp_file="Model.cs;BLL.cs;DAL.cs" save_file=".\Model\Model_{field_seltable_name}.cs;.\BLL\BLL_{field_seltable_name}.cs;.\DAL\DAL_{field_seltable_name}.cs"}

            {fyp_namespace}.BLL.BLL_{field_seltable_name} bll_{field_seltable_name} = new {fyp_namespace}.BLL.BLL_{field_seltable_name}();
            DataTable dt_{field_seltable_name} = bll_{field_seltable_name}.GetDataTable("");
            fillCtrlData.FillListControl(this.{control_name}, dt_{field_seltable_name}, "{field_seltable_text}", "{field_seltable_value}", "--请选择--", "");
            dt_{field_seltable_name}.Dispose();
            {/field_seltable_level_check}
        {/field_seltable_name_check}
    {/fields_loop}
{/field_seltable_name_all_check}

            //编辑记录时导入数据，并设置相应属性
            if (bIsEdit)
            {
                //设置相应属性
                this.btnSubmit.Text = "修改";

                //编辑时设置只读状态
            {fields_loop}
                {field_edit_readonly_check value="true" match="true"}
                this.{control_name}.ReadOnly = true;
                {/field_edit_readonly_check}
            {/fields_loop}

                //导入数据
                {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name} = GetModelData();
                if (model_{table_source_name} != null)
                {
                    try
                    {
        {field_seltable_name_all_check value="不链接表" match="false"}
                        //根据条件填充下拉框
            {fields_loop}
                {field_seltable_name_check value="不链接表" match="false"}
                    {field_seltable_level_check value="0|1" match="false"}
                        {remark note="说明："}生成关联表的三层文件{/remark}
                        {create_file table="{field_seltable_name}" fields="*" temp_file="Model.cs;BLL.cs;DAL.cs" save_file=".\Model\Model_{field_seltable_name}.cs;.\BLL\BLL_{field_seltable_name}.cs;.\DAL\DAL_{field_seltable_name}.cs"}

                        if (model_{table_source_name}.{field_source_name next="-1"} != null && model_{table_source_name}.{field_source_name next="-1"}.ToString().Length > 0)
                        {
                        {remark note="说明："}如ID与value相同，可直接读取{/remark}
                        {value_match_check value1="{field_seltable_id}" value2="{field_seltable_value}" extend_match="equal"}
                            {fyp_namespace}.BLL.BLL_{field_seltable_name} bll_{field_seltable_name} = new {fyp_namespace}.BLL.BLL_{field_seltable_name}();
                            DataTable dt_{field_seltable_name} = bll_{field_seltable_name}.GetDataTable("{field_seltable_parent_id}={get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name}" field="{field_seltable_parent_id}"}" + model_{table_source_name}.{field_source_name next="-1"}.ToString() + "{get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name}" field="{field_seltable_parent_id}"}");
                            fillCtrlData.FillListControl(this.{control_name}, dt_{field_seltable_name}, "{field_seltable_text}", "{field_seltable_value}", "--请选择--", "");
                            dt_{field_seltable_name}.Dispose();
                        {/value_match_check}

                        {remark note="说明："}如ID与value不同，需通过value获取ID（待调整）{/remark}
                        {value_match_check value1="{field_seltable_id}" value2="{field_seltable_value}" extend_match="unequal"}
                            //string strIndex = dbManager.Read("select [{field_seltable_id next="-1"}] from [{field_seltable_name next="-1"}] where [{field_seltable_value next="-1"}]={get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name next="-1"}" field="{field_seltable_value next="-1"}"}" + model_{table_source_name}.{field_source_name next="-1"}.ToString() + "{get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name next="-1"}" field="{field_seltable_value next="-1"}"}")["{field_seltable_id next="-1"}"].ToString();
                            string strIndex = new {fyp_namespace}.BLL.BLL_{field_seltable_name next="-1"}().GetModel(model_{table_source_name}.{field_source_name next="-1"}).{field_seltable_id next="-1"}.ToString();

                            {fyp_namespace}.BLL.BLL_{field_seltable_name} bll_{field_seltable_name} = new {fyp_namespace}.BLL.BLL_{field_seltable_name}();
                            DataTable dt_{field_seltable_name} = bll_{field_seltable_name}.GetDataTable("{field_seltable_parent_id}={get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name}" field="{field_seltable_parent_id}"}" + strIndex + "{get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name}" field="{field_seltable_parent_id}"}");
                            fillCtrlData.FillListControl(this.{control_name}, dt_{field_seltable_name}, "{field_seltable_text}", "{field_seltable_value}", "--请选择--", "");
                            dt_{field_seltable_name}.Dispose();
                        {/value_match_check}
                        }
                    {/field_seltable_level_check}
                {/field_seltable_name_check}
            {/fields_loop}
        {/field_seltable_name_all_check}
                        {fields_loop}
                        {control_style_check value="密码框|隐藏域|时分框|时分秒框|日时选择|日期选择|上载文件|上载到库|上载图片|图片到库" match="false"}
                        this.{control_name}.Text = model_{table_source_name}.{field_variable}.ToString();
                        {/control_style_check}

                        {control_style_check value="隐藏域" match="true"}
                        this.{control_name}.Value = model_{table_source_name}.{field_variable}.ToString();
                        {/control_style_check}

                        {control_style_check value="上载文件|上载图片" match="true"}
                        this.{control_name}.ToolTip = model_{table_source_name}.{field_variable}.ToString();
                        if (model_{table_source_name}.{field_variable} != null && model_{table_source_name}.{field_variable}.ToString().Length > 0)
                        {
                            this.lab_{control_name}_file.Text = "<br><a href='" + model_{table_source_name}.{field_variable}.ToString() + "' target='_blank'> >> 查看 " + model_{table_source_name}.{field_variable}.ToString() + "</a>";
                            this.btn_{control_name}_file_del.Text = " >> 删除文件";
                            this.btn_{control_name}_file_del.CommandArgument = model_{table_source_name}.{field_variable}.ToString();
                        }
                        {/control_style_check}
                        {control_style_check value="上载到库|图片到库" match="true"}
                        if (!FypSystem.Common.StringExtend.IsEmpty(model_{table_source_name}.{field_variable}))
                        {
                            this.btn_{control_name}_file.Text = "<br> >> 下载文件";
                            this.btn_{control_name}_file_del.Text = " >> 删除文件";
                        }
                        {/control_style_check}

                        {control_style_check value="密码框" match="true"}
                        //密码框
                        this.{control_name}.Attributes.Add("value", model_{table_source_name}.{field_variable}.ToString());
                        {/control_style_check}

                        {control_style_check value="时分框" match="true"}
                        //显示时分
                        if (model_{table_source_name}.{field_variable} != null && model_{table_source_name}.{field_variable}.ToString().Length > 0)
                            this.{control_name}.Text = FypSystem.Common.StringExtend.FormatDateTime(model_{table_source_name}.{field_variable}, "hh:mm");
                        {/control_style_check}
                        {control_style_check value="时分秒框" match="true"}
                        //显示时分秒
                        if (model_{table_source_name}.{field_variable} != null && model_{table_source_name}.{field_variable}.ToString().Length > 0)
                            this.{control_name}.Text = FypSystem.Common.StringExtend.FormatDateTime(model_{table_source_name}.{field_variable}, "hh:mm:ss");
                        {/control_style_check}
                        {control_style_check value="日时选择" match="true"}
                        //显示日期时间
                        if (model_{table_source_name}.{field_variable} != null && model_{table_source_name}.{field_variable}.ToString().Length > 0)
                            this.{control_name}.Text = FypSystem.Common.StringExtend.FormatDateTime(model_{table_source_name}.{field_variable}, "yyyy-MM-dd hh:mm:ss");
                        {/control_style_check}
                        {control_style_check value="日期选择" match="true"}
                        //显示日期
                        if (model_{table_source_name}.{field_variable} != null && model_{table_source_name}.{field_variable}.ToString().Length > 0)
                            this.{control_name}.Text = FypSystem.Common.StringExtend.FormatDateTime(model_{table_source_name}.{field_variable}, "yyyy-MM-dd");
                        {/control_style_check}

                        {field_input_again_check value="true" match="true"}
                        //要求两次输入
                        {control_style_check value="密码框|时分框|时分秒框|日时选择|日期选择" match="false"}
                        this.{control_name}_again.Text = model_{table_source_name}.{field_variable}.ToString();
                        {/control_style_check}

                        {control_style_check value="密码框" match="true"}
                        //密码框
                        this.{control_name}_again.Attributes.Add("value", model_{table_source_name}.{field_variable}.ToString());
                        {/control_style_check}
                        {/field_input_again_check}
                        {/fields_loop}
                    }
                    catch (System.Exception err)
                    {
                        FypSystem.Common.WebPage.JsAlert(this, err.Message);
                    }
                }
                else
                {
                    //找不到指定记录时
                    FypSystem.Common.WebPage.JsAlert(this, "未找到指定记录！");
                }
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            SaveData();
        }

        /// <summary>
        /// 保存数据
        /// </summary>
        private void SaveData()
        {
            bool bSta = false;
            string strMsg = "";
            string strUrl = this.Request.Url.ToString();

            {remark}校验码{/remark}
            {valid_code_check value="true" match="true"}
            if (FypSystem.Common.StringExtend.NullToEmptyStr(Session["valid_code"]).ToLower() != this.ctrl_ValidCode.Text.ToLower())
            {
                strMsg = "输入的校验码不正确。";
            }
            else {/valid_code_check}if (this.Page.IsValid)
            {
                try
                {
                {control_style_all_check value="上载到库|上载文件|上载图片|图片到库|批量上载" match="true"}
                    //读取保存的记录信息
                    {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name}_Old = GetModelData();
                    //读取保存上载文件的设置
                    FypSystem.Common.FileSys fileSys = new FypSystem.Common.FileSys();
                    string strSavePath = WebPage.GetConfig("fypSavePath");
                    string strWaterMarkPath = WebPage.GetConfig("fypWaterMarkPath");
                    string strAllowExt = WebPage.GetConfig("fypAllowExt");
                    int iMaxSize = Convert.ToInt32(WebPage.GetConfig("fypMaxSize"));
                {/control_style_all_check}

                    {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name} = GetModelData();
                {fields_loop}
                {control_style_check value="上载到库|上载文件|上载图片|图片到库" match="false"}
                    {value_match_check value1='{field_code_datatype_name code="cs" type="3" compatible="false"}' value2="string" extend_match="unequal"}
                    if (this.{control_name}.Text.Length > 0)
                        model_{table_source_name}.{field_variable} = {field_code_datatype_name code="cs" type="3" compatible="false"}.Parse(this.{control_name}.Text);
                    else
                        model_{table_source_name}.{field_variable} = null;
                    {/value_match_check}

                    {value_match_check value1='{field_code_datatype_name code="cs" type="3" compatible="false"}' value2="string" extend_match="equal"}
                    if (this.{control_name}.Text.Length > 0)
                        model_{table_source_name}.{field_variable} = this.{control_name}.Text;
                    {/value_match_check}
                {/control_style_check}

                {control_style_check value="上载文件|上载图片" match="true"}
                    //选择文件后才进行上载
                    if (this.{control_name}.FileName.Length > 0)
                    {
                        //使用原文件名上载
                        //model_{table_source_name}.{field_variable} = strSavePath + this.{control_name}.FileName;
                        //使用系统生成的新文件名
                        model_{table_source_name}.{field_variable} = strSavePath + MathExtend.NumToStrJZ("datetime", 36) + System.IO.Path.GetExtension(this.{control_name}.FileName);
                        if (bIsEdit)
                        {
                            //保存文件时，如已经上载文件，则使用旧文件名
                            string str{field_source_name}_old = model_{table_source_name}_Old.{field_source_name}.ToString();
                            if (str{field_source_name}_old.Length > 0)
                            {
                                model_{table_source_name}.{field_variable} = fileSys.RemoveExtName(str{field_source_name}_old) + System.IO.Path.GetExtension(this.{control_name}.FileName);
                                System.IO.File.Delete(fileSys.GetAbsPath(str{field_source_name}_old));
                            }
                        }
                        {control_style_check value="上载文件" match="true"}
                        //上载文件到服务器
                        fileSys.UploadFile(this.{control_name}, false, model_{table_source_name}.{field_variable}.ToString(), strAllowExt, iMaxSize, true);
                        {/control_style_check}
                        {control_style_check value="上载图片" match="true"}
                        //上载图片到服务器，并添加水印
                        fileSys.UploadFile(this.{control_name}, false, model_{table_source_name}.{field_variable}.ToString(), strAllowExt, iMaxSize, true, true, strWaterMarkPath, 9);
                        {/control_style_check}
                    }
                {/control_style_check}

                    {control_style_check value="上载到库" match="true"}
                    //上载文件到数据库中
                    if (this.{control_name}.FileBytes.Length > 0)
                        model_{table_source_name}.{field_variable} = this.{control_name}.FileBytes;
                    {/control_style_check}
                    {control_style_check value="图片到库" match="true"}
                    //上载图片到数据库中，并添加水印
                    if (this.{control_name}.FileBytes.Length > 0)
                    {
                        FypSystem.Common.ImageExtend image = new ImageExtend();
                        model_{table_source_name}.{field_variable} = image.AddWaterMark(strWaterMarkPath, 9, 0.5f, this.{control_name}.FileBytes, this.{control_name}.FileName);
                    }
                    {/control_style_check}
                {/fields_loop}

                    {fyp_namespace}.BLL.BLL_{table_source_name} bll_{table_source_name} = new {fyp_namespace}.BLL.BLL_{table_source_name}();
                    if (bIsEdit)
                        bll_{table_source_name}.Update(model_{table_source_name});
                    else
                        bll_{table_source_name}.Add(model_{table_source_name});

                    strMsg = "保存数据成功";
                    bSta = true;
                }
                catch (System.Exception err)
                {
                    strMsg = "保存数据时出错：" + err.Message;
                }
            }
            else
            {
                strMsg = "输入信息不正确";
            }
            if (bSta)
                FypSystem.Common.WebPage.JsRun(this, "ShowMsg(\"" + FypSystem.Common.WebPage.FormatJsStr(strMsg) + "\");try{window.opener.location.reload(); window.close();}catch(e){GoUrl('" + strUrl + "')}");
            else
                FypSystem.Common.WebPage.JsAlert(this, strMsg, "");
        }

    {fields_loop}
    {remark note="说明："}当前字段及下级字段设置的级别不为0，才生成级联代码{/remark}
    {field_seltable_level_check value="0|null" match="false" next="1"}
        {field_seltable_level_check value="0|null" match="false"}
        protected void {control_name}_SelectedIndexChanged(object sender, EventArgs e)
        {
            //选择列表项目时，填充下级下拉框
            if (this.{control_name}.SelectedValue.Length > 0)
            {
                {fyp_namespace}.BLL.BLL_{field_seltable_name next="1"} bll_{field_seltable_name next="1"} = new {fyp_namespace}.BLL.BLL_{field_seltable_name next="1"}();
                DataTable dtTable = bll_{field_seltable_name next="1"}.GetDataTable("{field_seltable_parent_id next="1"}={get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name next='1'}" field='{field_seltable_parent_id next="1"}'}" + this.{control_name}.SelectedValue + "{get_table_field_settings tag_name="field_single_quote" table="{field_seltable_name next='1'}" field='{field_seltable_parent_id next="1"}'}");
                FypSystem.DBManager.FillCtrlData fillCtrlData = new FillCtrlData();
                fillCtrlData.FillListControl(this.{control_name next="1"}, dtTable, "{field_seltable_text next="1"}", "{field_seltable_value next="1"}", "--请选择--", "");
            }
        }
        {/field_seltable_level_check}
    {/field_seltable_level_check}

    {control_style_check value="上载到库|图片到库" match="true"}
        protected void btn_{control_name}_file_Click(object sender, EventArgs e)
        {
            DownLoadFile("{control_name}_" + {fields_loop type="3" separator=' + "_" + ' distinct="true"}req_{field_source_name}{/fields_loop}, "{field_source_name}");
        }

        protected void btn_{control_name}_file_del_Click(object sender, EventArgs e)
        {
            DelFile("{field_source_name}", "");
        }
    {/control_style_check}
    {control_style_check value="上载文件|上载图片" match="true"}
        protected void btn_{control_name}_file_del_Command(object sender, CommandEventArgs e)
        {
            DelFile("{field_source_name}", e.CommandArgument.ToString());
        }
    {/control_style_check}
    {/fields_loop}

    {control_style_all_check value="上载文件|上载到库|上载图片|图片到库" match="true" type="1"}
        /// <summary>
        /// 删除保存于数据库或磁盘文件
        /// </summary>
        /// <param name="strFieldName">保存文件名或文件字节信息的字段名</param>
        /// <param name="strFileName">文件名，如文件保存于数据库，传入空值</param>
        private void DelFile(string strFieldName, string strFileName)
        {
            string strMsg = "";
            string strUrl = "";
            {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name} = GetModelData();
            if (model_{table_source_name} != null)
            {
                try
                {
                    if (strFileName.Length > 0)
                    {
                        FypSystem.Common.FileSys fileSys = new FileSys();
                        string strFilePath = fileSys.GetAbsPath(strFileName);
                        System.IO.File.Delete(strFilePath);
                    }
                {fields_loop}
                    {control_style_check value="上载文件|上载到库|上载图片|图片到库" match="true"}
                    if (strFieldName == "{field_source_name}")
                        model_{table_source_name}.{field_variable} = null;
                    {/control_style_check}
                {/fields_loop}
                    new {fyp_namespace}.BLL.BLL_{table_source_name}().Update(model_{table_source_name});

                    strMsg = "成功删除文件";
                    strUrl = this.Request.Url.ToString();
                }
                catch (System.Exception err)
                {
                    strMsg = "出错提示：" + err.Message;
                }
                FypSystem.Common.WebPage.JsAlert(this, strMsg, strUrl);
            }
        }

        {control_style_all_check value="上载到库|图片到库" match="true" type="1"}
        /// <summary>
        /// 下载保存于数据库中的文件
        /// </summary>
        /// <param name="strFileName">指定的下载文件名</param>
        /// <param name="strFieldName">字段名</param>
        private void DownLoadFile(string strFileName, string strFieldName)
        {
            {fyp_namespace}.Model.Model_{table_source_name} model_{table_source_name} = GetModelData();
            if (model_{table_source_name} != null)
            {
                strFileName = this.Server.UrlPathEncode(strFileName);
                FypSystem.Common.FileSys fileSys = new FileSys();
            {fields_loop}
                {control_style_check value="上载到库|图片到库" match="true"}
                if (strFieldName == "{field_source_name}")
                    fileSys.DownloadFileInDB(strFileName, (byte[])model_{table_source_name}.{field_variable});
                {/control_style_check}
            {/fields_loop}
            }
        }
        {/control_style_all_check}
    {/control_style_all_check}
    }
}