Beispiel #1
0
        protected void LoadInfo()
        {
            ddl_SysModel.DataSource     = TemplateAction.AllSysModel;
            ddl_SysModel.DataTextField  = "ModelName";
            ddl_SysModel.DataValueField = "ID";
            ddl_SysModel.DataBind();

            int             id = WS.RequestInt("id");
            TemplateContent tl = TemplateContentView.GetModelByID(id.ToS());

            txt_TempName.Text          = tl.TempName;
            txt_TimeFormat.Text        = tl.TimeFormat;
            txt_Content.Text           = tl.Content;
            ddl_SysModel.SelectedValue = tl.SysModel.ToS();
        }
Beispiel #2
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            int             id = WS.RequestInt("id");
            TemplateContent tl = TemplateContentView.GetModelByID(id.ToS());

            tl.TempName   = txt_TempName.Text;;
            tl.TimeFormat = txt_TimeFormat.Text;
            tl.Content    = txt_Content.Text.Replace("'", "''");
            tl.SysModel   = ddl_SysModel.SelectedValue.ToInt32();
            if (tl.ID > 0)
            {
                TemplateContentView.Update(tl);
            }
            else
            {
                tl.GroupID  = 1;
                tl.SysModel = 1;
                TemplateContentView.Insert(tl);
            }
            Js.AlertAndGoback("保存成功!");
        }
Beispiel #3
0
        /// <summary>
        /// 加载信息
        /// </summary>
        protected void LoadInfo()
        {
            cp_TitleColor.Value = "000";
            sp_cor.Style["background-color"] = "#" + cp_TitleColor.Value;

            ddl_Class.DataSource     = NewsAction.NewsClass;
            ddl_Class.DataTextField  = "ClassName";
            ddl_Class.DataValueField = "ID";
            ddl_Class.DataBind();

            ddl_Class.SelectedValue = cls.ToS();

            ddl_contentTemp.DataSource     = TemplateContentView.GetModelList();
            ddl_contentTemp.DataTextField  = "TempName";
            ddl_contentTemp.DataValueField = "ID";
            ddl_contentTemp.DataBind();
            ddl_contentTemp.Items.Add(new ListItem("--使用默认模板--", "0"));
            ddl_contentTemp.SelectedValue = "0";

            txt_FileForder.Text = DateTime.Now.ToString("yyyy-MM-dd");

            txt_Author.Text = SysUserAction.LocalUser.UserName;

            if (WS.RequestInt("id") <= 0)
            {
                txt_NewsTime.Text = DateTime.Now.ToString();
                return;
            }

            News n = NewsView.GetModelByID(WS.RequestString("id"));

            ddl_Class.SelectedValue = n.ClassID.ToS();

            txt_Title.Text      = n.Title;
            cp_TitleColor.Value = n.TitleColor;
            chk_TitleB.Checked  = n.TitleB;
            chk_TitleI.Checked  = n.TitleI;
            chk_TitleS.Checked  = n.TitleS;

            txt_FTitle.Text = n.FTitle;

            chk_Audit.Checked   = n.Audit;
            chk_Tuijian.Checked = n.Tuijian;
            chk_Toutiao.Checked = n.Toutiao;

            txt_Key.Text         = n.KeyWords;
            txt_NavUrl.Text      = n.NavUrl;
            txt_NewsTime.Text    = n.NewsTime.ToString();
            txt_TitleImage.Text  = n.TitleImage;
            txt_Description.Text = n.Description;
            txt_Author.Text      = n.Author;
            txt_Source.Text      = n.Source;
            FCKeditor1.Value     = n.Content;
            FCKeditor2.Value     = n.ContentEn;

            chk_SetTop.Checked            = n.SetTop;
            chk_CloseReply.Checked        = !n.EnableReply;
            ddl_contentTemp.SelectedValue = n.ModelID.ToString();
            txt_ClickCount.Text           = n.ClickCount.ToString();
            txt_DownCount.Text            = n.DownCount.ToString();
            txt_FileForder.Text           = n.FileForder;
            txt_FileName.Text             = n.FileName;
        }
Beispiel #4
0
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            string ids = WS.RequestString("id");

            TemplateContentView.Del(string.Format("id in ({0})", ids));
        }
Beispiel #5
0
 protected void BindList()
 {
     rp_list.DataSource = TemplateContentView.GetModelList();
     rp_list.DataBind();
 }