⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sitetask_edit.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
📖 第 1 页 / 共 2 页
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
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 NetCMS.Content;
using NetCMS.Content.Common;

public partial class manage_publish_siteTask_edit : NetCMS.Web.UI.ManagePage
{
    #region
    rootPublic rd = new rootPublic();
    Psframe pd = new Psframe();
    public string classidd = "";//取classid的值
    public string newsidd = "";//取newsid的值
    public string specialidd = "";//取special的值
    public string timesett = "";//定时
    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Response.CacheControl = "no-cache"; //设置页面无缓存
            
            //LoginInfo.CheckPop("权限代码", "0", "1", "9"); //权限代码
            copyright.InnerHtml = CopyRight;
            Start();//初始参数设置信息  
        }

        /// <summary>
        /// 获取新闻,栏目,专题列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        #region 获取新闻,栏目,专题列表
        divClassNews.InnerHtml = getClassNews("divclassNews");
        divClassClass.InnerHtml = getClassNews("divclassClass");
        DivSpecial.InnerHtml = getSpecial();
        #endregion
    }

    /// <summary>
    /// 初始参数设置信息
    /// </summary>
    /// <returns></returns>
    ///code by chenzhaohui 

    protected void Start()
    { 
        string taskid = Request.QueryString["taskID"];
        if (taskid == null || taskid == "" || taskid == string.Empty)
        {
            PageError("参数错误", "siteTask.aspx");
        }
        else
        {
            DataTable dt = pd.getTaskIDInfo(taskid);
            if (dt != null && dt.Rows.Count > 0)
            {
                this.TaskName.Text = dt.Rows[0]["TaskName"].ToString();//任务名称

                #region 发布首页
                if (dt.Rows[0]["isIndex"].ToString() == "1")
                {
                    isIndex.Checked = true;
                }
                else
                {
                    isIndex.Checked = false;
                }
                #endregion

                this.CreatTime.Text = dt.Rows[0]["CreatTime"].ToString();//创建时间

                #region 取栏目数组的值
                string class_value = dt.Rows[0]["ClassID"].ToString();//取classid的值

                string all_class = "";//所有
                string every_class = "";//每天
                string today_class = "";//今天
                
                all_class = class_value.Split('|')[0];//所有
                every_class = class_value.Split('|')[1];//每天
                today_class = class_value.Split('|')[2];//今天
                                
                #region 程序版本
                string str_publicType = NetCMS.Config.verConfig.PublicType;
                #endregion
                #region 版本1
                if (str_publicType == "1")
                {
                    if (all_class == "1")
                    {
                        AllClass1.Checked = true;
                    }
                    else
                    {
                        AllClass1.Checked = false;
                    }
                    if (every_class == "1")
                    {
                        EveryDayClass1.Checked = true;
                    }
                    else
                    {
                        EveryDayClass1.Checked = false;
                    }
                    if (today_class == "1")
                    {
                        TodayClass1.Checked = true;
                    }
                    else
                    {
                        TodayClass1.Checked = false;
                    }
                }
                #endregion
                #region 版本0
                else 
                {
                    if (all_class == "1")
                    {
                        AllClass0.Checked = true;
                    }
                    else
                    {
                        AllClass0.Checked = false;
                    }
                    if (today_class == "1")
                    {
                        TodayClass0.Checked = true;
                    }
                    else
                    {
                        TodayClass0.Checked = false;
                    }
                    every_class = "0";
                }
                #endregion
                
                #endregion              
            }
            else
            {
                PageError("参数错误","shortcut_list.aspx");
            }
        }
        Startt();
    }

    /// <summary>
    /// 显示栏目修改时选择的值(js回调)
    /// </summary>
    /// code by chenzhaohui

    protected void showjs()
    {
         string taskid = Request.QueryString["taskID"];
         if (taskid == null || taskid == "" || taskid == string.Empty)
         {
             PageError("参数错误", "siteTask.aspx");
         }
         else
         {
             DataTable dt = pd.getTaskIDInfo(taskid);
             if (dt != null && dt.Rows.Count > 0)
             {
                 string class_value = dt.Rows[0]["ClassID"].ToString();//取classid的值
                 string news = dt.Rows[0]["News"].ToString();//取news的值
                 string special = dt.Rows[0]["Special"].ToString();//取special的值
                 string time = dt.Rows[0]["TimeSet"].ToString();//取timeset的值
                 
                 #region classid数组
                 classidd = class_value.Split('|')[3];//classid数组
                 Response.Write("<script language=\"javascript\">PageClass('" + classidd + "');</script>\r");
                 #endregion

                 #region news数组
                 newsidd = news.Split('|')[4];//newsid数组
                 Response.Write("<script language=\"javascript\">PageNews('" + newsidd + "');</script>\r");
                 #endregion

                 #region special数组
                 specialidd = special;//special数组
                 Response.Write("<script language=\"javascript\">PageSpecial('" + specialidd + "');</script>\r");
                 #endregion

                 #region 定时
                 timesett = time;//timeset数组
                 Response.Write("<script language=\"javascript\">PageTimeSet('" + timesett + "');</script>\r");
                 #endregion
             }
         }
    }

    protected void Startt()
    { 
        
        string taskid = Request.QueryString["taskID"];
        if (taskid == null || taskid == "" || taskid == string.Empty)
        {
            PageError("参数错误", "siteTask.aspx");
        }
        else
        { 
             DataTable dt = pd.getTaskIDInfo(taskid);
             if (dt != null && dt.Rows.Count > 0)
             {
                 string news = dt.Rows[0]["News"].ToString();//取news的值
                 string newsidd = "";//按ID发布
                 string newstime = "";//按日期发布
                 string lastnews = "";//按最新数发布
                 string unhtml = "";
                 if (news.Split('|')[0] == "1")
                 {
                     Response.Write("<script language=\"javascript\">DispChange(9);</script>\r");
                     this.AllNews.Checked = true;
                 }
                 else
                 {
                     this.AllNews.Checked = false;
                 }

                 newsidd = news.Split('|')[1];
                 if (news.Split('|')[1] != "0")
                 {
                     //Response.Write("<script language=\"javascript\">DispChange(0);</script>\r");
                     this.NewsID1.Text = newsidd.Split(',')[0];
                     this.NewsID2.Text = newsidd.Split(',')[1];
                     this.NewsID.Checked = true;
                 }
                 else
                 {
                     this.NewsID1.Text = "";
                     this.NewsID2.Text = "";
                     this.NewsID.Checked = false;
                 }

                 newstime = news.Split('|')[2];
                 if (news.Split('|')[2] != "0")
                 {
                     //Response.Write("<script language=\"javascript\">DispChange(1);</script>\r");
                     this.Data1.Text = newstime.Split(',')[0];
                     this.Data2.Text = newstime.Split(',')[1];
                     this.Data.Checked = true;
                 }
                 else
                 {
                     this.Data1.Text = "";
                     this.Data2.Text = "";
                     this.Data.Checked = false;
                 }

                 lastnews = news.Split('|')[3];
                 if (news.Split('|')[3] != "0")
                 {
                     //Response.Write("<script language=\"javascript\">DispChange(2);</script>\r");
                     this.LastNewsNum.Text = lastnews;
                     this.LastNewsNum_checkbox.Checked = true;
                 }
                 else
                 {
                     this.LastNewsNum.Text = "";
                     this.LastNewsNum_checkbox.Checked = false;
                 }
                 unhtml = news.Split('|')[5];
                 if (news.Split('|')[5] != "0")
                 {
                     for (int k = 0; k < 2; k++)
                     {
                         if (this.unHTML.Items[k].Value == unhtml)
                         {
                             this.unHTML.Items[k].Selected = true;
                         }
                     }
                 }
             }
        }
    }

    /// <summary>
    /// 保存修改
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// code by chenzhaohui

    protected void Savetask_ServerClick(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            string taskid = Request.QueryString["taskid"];
            if (taskid == null || taskid == "" || taskid == string.Empty)
            {
                PageError("参数错误", "siteTask.aspx");
            }
            else
            {
                string Str_TaskName = this.TaskName.Text.Trim();//任务名

                #region 发布首页
                int isindexx = 0;
                if (isIndex.Checked)
                {
                    isindexx = 1;
                }
                else
                {
                    isindexx = 0;
                }
                #endregion

                #region 定时

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -