/*
 * 程序名称: JumboTCMS(将博内容管理系统通用版)
 * 
 * 程序版本: 6.x
 * 
 * 程序作者: 将博开发团队 (商业合作请联系：791104444@qq.com)
 * 
 * 版权申明: http://www.jumbotcms.net/about/copyright.html
 * 
 * 技术答疑: http://forum.jumbotcms.net/
 * 
 */

using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JumboTCMS.Utils;
using JumboTCMS.Common;

namespace JumboTCMS.WebFile.Admin
{
    public partial class _cut2thumb_upload : JumboTCMS.UI.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ChannelId = Str2Str(q("ccid"));
            Admin_Load("", "html", true);
            this.ThumbsSize.Items.Clear();
            ListItem li;
            doh.Reset();
            doh.ConditionExpress = "id=@id";
            doh.AddConditionParameter("@id", ChannelId);
            string _defaultThumbs = doh.GetField("jcms_normal_channel", "DefaultThumbs").ToString();
            DataTable dtThumbs = new JumboTCMS.DAL.Normal_ThumbsDAL().GetDataTable(ChannelId);
            for (int i = 0; i < dtThumbs.Rows.Count; i++)
            {
                li = new ListItem();
                li.Value = dtThumbs.Rows[i]["iWidth"].ToString() + "|" + dtThumbs.Rows[i]["iHeight"].ToString();
                li.Text = dtThumbs.Rows[i]["Title"].ToString();
                if (_defaultThumbs == dtThumbs.Rows[i]["ID"].ToString())
                    li.Selected = true;
                else
                    li.Selected = false;
                this.ThumbsSize.Items.Add(li);
            }
            dtThumbs.Clear();
            dtThumbs.Dispose();
            if (q("photo") != "")
            {
                NewsCollection nc = new NewsCollection();
                this.Image1.ImageUrl = nc.LocalFileUrl(site.Url, site.MainSite, q("photo"), ChannelUploadPath, true, 0, 0);
            }
        }
    }
}

