using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TopWinCMS.BLL;
using TopWinCMS.Common;
namespace TopWinCMS.WebUI.Admin.Window
{
    public partial class UpPic : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (DDL_ClassID.SelectedIndex == 0)
            //{
            //    MsgBox.Alert("请选择栏目再上传");
            //    return;
            //}

        }

        protected void BT_UpLoad_Click(object sender, EventArgs e)
        {
            if (FileUpload1.HasFile)
            {
                TopWinCMS.Model.ClassInfo model = new ClassManage().EditLoad(int.Parse( Request.QueryString["ClassID"]));
                string strSaveFile = model.PicPath;

                if (string.IsNullOrEmpty(strSaveFile) == true)
                {
                    strSaveFile = Config.UP;
                }
                strSaveFile += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                strSaveFile += FileUpload1.FileName;

                FileUpload1.SaveAs(Server.MapPath(strSaveFile));
                //TB_PicUrl.Text = strSaveFile;

                MyJavascript.RegJS(this,"ClickRetrun(\"" + strSaveFile + "\")");
            }
            else
            {
                MsgBox.Alert("请选择文件再上传！");
            }
        }
    }
}