918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/a99112df/ca2a8923/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/a99112df/ca2a8923/App_Web_5tazxwaj.17.cs
?#pragma checksum "D:\wwwroot\ldxynb\wwwroot\back\Class\ClassContent.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "C827B6A1A19F5DA9A5BC6024231B4897"

#line 1 "D:\wwwroot\ldxynb\wwwroot\back\Class\ClassContent.aspx.cs"
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 System.Data.Sql;using System.Data.SqlClient;
using CoreClass;
using System.Data.OleDb;



public partial class Back_Class_ClassContent : System.Web.UI.Page
{
    protected CoreClass.DBCommon dbc = new DBCommon();
    protected CoreClass.PublicFunction pubfun = new PublicFunction();
    public int classid = 0;
    public int channelid = 0;
    public string col = "class";
    protected void Page_Load(object sender, EventArgs e)
    {
        this.classid = Int32.Parse(Request.QueryString["classid"].Trim());
        this.channelid = Int32.Parse(Request.QueryString["channelid"].Trim());
        this.pubfun.checkAdminAccessRights(this.Page);
        pubfun.RegisterAdminPageClientScriptBlock(Page);
        col = pubfun.GetClassCol(channelid);
        if (!IsPostBack)
        {
            this.InitPage();
        }
    }

    private void InitPage()
    {
        //if (channelid == 31)
        //{
        //    Tr1.Visible = true;
        //    Tr2.Visible = false;
        //}
        DataRow row = dbc.ReadOneRow(col, "[classid]=" + this.classid.ToString());
        if (row != null)
        {
            this.classname.Text = row["classname"].ToString();
            this.Label1.Text = row["ppic"].ToString();

            Image1.ImageUrl = "../../" + row["ppic"].ToString();
            //this.HaodeUpload.parentSRC = row["ppic"].ToString();
            this.econtent.Text = row["econtent"].ToString();
            this.tedian.Text = row["tedian"].ToString();
            this.kehu.Text = row["kehu"].ToString();
        }
    }

    protected void btnOk_Click(object sender, EventArgs e)
    {
        //if (!pubfun.IsBlank(Label1.Text)) this.HaodeUpload.parentSRC = Label1.Text;
        System.Data.OleDb.OleDbCommand cmd = this.dbc.GetCommandBySql("update " + col + " set econtent=@econtent,ppic=@ppic,tedian=@tedian,kehu=@kehu where [classid]=" + this.classid);
        if (pubfun.IsBlank(this.econtent.Text)) this.econtent.Text = " ";
        cmd.Parameters.Add("@econtent", SqlDbType.Text).Value = this.econtent.Text;
        cmd.Parameters.Add("@ppic", OleDbType.VarChar, 250).Value = this.Label1.Text.Trim();
        cmd.Parameters.Add("@tedian", OleDbType.VarChar, 250).Value = this.tedian.Text.Trim();
        cmd.Parameters.Add("@kehu", OleDbType.VarChar, 250).Value = this.kehu.Text.Trim();
        cmd.Connection.Open();
        int irows = cmd.ExecuteNonQuery();
        cmd.Connection.Close();
        cmd.Connection.Dispose();
        cmd.Dispose();
        AddInfo.Enabled = false;
        pubfun.RegisterStartupScript(Page, "PAGE", "window.location.href='" + Request.Url.AbsoluteUri + "';");
        return;


        //if (!pubfun.IsBlank(Pic.Value)) this.HaodeUpload.parentSRC = Pic.Value;
        //OleDbCommand cmd = this.dbc.GetCommandBySql("update " + col + " set econtent=@econtent,ppic=@ppic,tedian=@tedian,kehu=@kehu where [classid]=" + this.classid);
        //if (pubfun.IsBlank(this.econtent.Text)) this.econtent.Text = " ";
        //cmd.Parameters.Add("@econtent", OleDbType.WChar).Value = this.econtent.Text;
        //cmd.Parameters.Add("@ppic", OleDbType.VarChar, 250).Value = this.Pic.Value.Trim();
        //cmd.Parameters.Add("@tedian", OleDbType.VarChar, 250).Value = this.tedian.Text.Trim();
        //cmd.Parameters.Add("@kehu", OleDbType.VarChar, 250).Value = this.kehu.Text.Trim();
        //cmd.Connection.Open();
        //int irows = cmd.ExecuteNonQuery();
        //cmd.Connection.Close();
        //cmd.Connection.Dispose();
        //cmd.Dispose();
        //AddInfo.Enabled = false;
        //pubfun.RegisterStartupScript(Page, "PAGE", "window.location.href='" + Request.Url.AbsoluteUri + "';");
        //return;






    }
    protected void Button1_Click(object sender, EventArgs e)
    {
 
            if (FileUpload2.PostedFile.ContentLength < 500000)//100000为100K   
            {
                string fileFullname = this.FileUpload2.FileName;
                string dataName = DateTime.Now.ToString("yyyyMMddhhmmss");
                string fileName = fileFullname.Substring(fileFullname.LastIndexOf("\\") + 1);
                string type = fileFullname.Substring(fileFullname.LastIndexOf(".") + 1);
                if (type == "bmp" || type == "jpg" || type == "gif" || type == "JPG" || type == "BMP" || type == "GIF")
                {
                    this.FileUpload2.SaveAs(Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type);
                    string ProImg = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                    string strimgs = "HaodeUpload/UploadedFiles/" + dataName + "." + type;


                    ////裁剪 过大的图片
                    //string wlurl = Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type;
                    //string PicturePath = wlurl;
                    //string PicturePat2h = wlurl;


                    //if (Convert.ToInt32(dyc.getImageWidthAndHeightwww(PicturePath)) > 600 || Convert.ToInt32(dyc.getImageWidthAndHeightww22w(PicturePath)) > 480)
                    //{

                    //    dyc.ImgLimitedSize(600, 480, PicturePath, PicturePat2h);
                    //}
                    this.Label1.Text = strimgs;

                    //bs.user("insert into addpic(stye_id,tp_url,tp_time) values('" + infid + "','" + strimgs + "','" + System.DateTime.Now.ToString() + "')");




                   
                }
                else
                {
                    Response.Write("<script language='javascript'>alert('支持体式:|jpg|gif|bmp|');</script>");
                }
            }
            else
            {
                Response.Write("<script language='javascript'>alert('你的图片已经超过500K的大。');</script>");
            }

       

    }
}


#line default
#line hidden