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/712bd9e6/ca967f19/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/712bd9e6/ca967f19/App_Web_jybcsqjj.7.cs
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\fuwu\fuwu.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "B417AFC680871AA10201F9CCC0EC7709C8CBA2D3"

#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\fuwu\fuwu.aspx.cs"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class sysmanage_files_fuwu_fuwu : System.Web.UI.Page
{
    protected string strtitle = "新增服务";
    protected string strpic = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        login.OnLine();

        if (!IsPostBack)
        {

            BindLGType();
            BindFenLei();
            this.txt_date.Text = DateTime.Now.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToLongTimeString();
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                strtitle = "编纂服务";
                int id = Convert.ToInt32(Request.QueryString["id"]);
                ViewState["id"] = id;
                BindNewsData(id);
            }
        }

    }



    //绑定说话版本
    protected void BindLGType()
    {
        DataTable dt = SQLServerHelper.ExecuteTable("select id,lg from TB_LG");
        if (dt.Rows.Count > 0)
        {
            this.ddl_lg.DataSource = dt;
            this.ddl_lg.DataTextField = "lg";
            this.ddl_lg.DataValueField = "id";
            this.ddl_lg.DataBind();
        }
    }

    //绑定分类
    protected void BindFenLei()
    {
        DataTable dt = SQLServerHelper.ExecuteTable("select id,sname from TB_FuWuClass where fid = 0 order by id asc");
        if (dt.Rows.Count > 0)
        {
            this.ddl_type.Items.Clear();
            this.ddl_type.Items.Add(new ListItem("请选择", ""));
            this.ddl_type.DataSource = dt;
            this.ddl_type.DataTextField = "sname";
            this.ddl_type.DataValueField = "id";
            this.ddl_type.DataBind();
        }
    }

    /// <summary>
    /// 凭据ID取新闻内容
    /// </summary>
    /// <param name="id"></param>
    protected void BindNewsData(int id)
    {
        DataTable dt = SQLServerHelper.ExecuteTable("select * from TB_FuWu where id = " + id + "");
        if (dt.Rows.Count > 0)
        {
            this.txt_title.Text = dt.Rows[0]["title"].ToString();
            this.txt_order.Text = dt.Rows[0]["orders"].ToString();
            this.txt_content.Value = dt.Rows[0]["contents"].ToString();
            this.ddl_type.SelectedValue = dt.Rows[0]["types"].ToString();
            this.ddl_lg.SelectedValue = dt.Rows[0]["lg"].ToString();
            this.txt_clickcount.Text = dt.Rows[0]["clickcount"].ToString();
            BindFenLei();
            if (dt.Rows[0]["fenlei"].ToString() != "")
            {

                DataTable dtlxs = SQLServerHelper.ExecuteTable("select id,sname from TB_FuWuClass where fid = " + ddl_type.SelectedValue);
                ddl_leixing.Items.Clear();
                this.ddl_leixing.Items.Add(new ListItem("不限", "0"));
                if (dtlxs != null && dtlxs.Rows.Count > 0)
                {

                    ddl_leixing.DataSource = dtlxs;
                    ddl_leixing.DataTextField = "sname";
                    ddl_leixing.DataValueField = "id";
                    ddl_leixing.DataBind();

                }
                ddl_leixing.SelectedValue = dt.Rows[0]["fenlei"].ToString();
            }

            this.txt_date.Text = Convert.ToDateTime(dt.Rows[0]["regtime"].ToString()).ToString("yyyy-M-dd") + " " + Convert.ToDateTime(dt.Rows[0]["regtime"].ToString()).ToLongTimeString();
            if (dt.Rows[0]["pic"].ToString() != "") //图片
            {
                strpic = dt.Rows[0]["pic"].ToString();
                ClientScript.RegisterStartupScript(this.GetType(), "dsf", "<script language='javascript'>setpic('pic_show','pic_up')</script>");
            }
        }
    }


    protected void bt_add_Click(object sender, EventArgs e)
    {
        if (ViewState["id"] != null)
        {

            string strsql = string.Empty;
            string pic = string.Empty;
            if (FileUpPIC.FileName != null && FileUpPIC.FileName != "")
            {
                pic = PicUtil.PicUp(FileUpPIC, "upfile/propic");//上传照片
                if (pic == "")
                {
                    return;
                }
                strsql = "update TB_FuWu set title='" + this.txt_title.Text.Trim() + "',pic = '" + pic + "',contents = '" + this.txt_content.Value + "',types = " + this.ddl_type.SelectedValue.ToString().Trim() + ",fenlei = " + this.ddl_leixing.SelectedValue + ",clickcount = " + this.txt_clickcount.Text.Trim() + ",orders = " + this.txt_order.Text.Trim() + ",regtime = '" + this.txt_date.Text.Trim() + "',lg = " + this.ddl_lg.SelectedValue.Trim() + " where id = " + ViewState["id"] + "";
            }
            else
            {
                strsql = "update TB_FuWu set title='" + this.txt_title.Text.Trim() + "',contents = '" + this.txt_content.Value + "',types = " + this.ddl_type.SelectedValue.ToString().Trim() + ",fenlei = " + this.ddl_leixing.SelectedValue + ",clickcount = " + this.txt_clickcount.Text.Trim() + ",orders = " + this.txt_order.Text.Trim() + ",regtime = '" + this.txt_date.Text.Trim() + "',lg = " + this.ddl_lg.SelectedValue.Trim() + " where id = " + ViewState["id"] + "";
            }
            if (SQLServerHelper.execNonQuery(strsql))
            {
                Response.Redirect("fuwulist.aspx");
                return;
            }

        }
        else
        {
            string strsql = string.Empty;
            string pic = string.Empty;
            if (FileUpPIC.FileName != null && FileUpPIC.FileName != "")
            {
                pic = PicUtil.PicUp(FileUpPIC, "upfile/propic");//上传照片
                if (pic == "")
                {
                    return;
                }

            }

            strsql = "insert into TB_FuWu (title,orders,contents,pic,lg,types,fenlei,clickcount,regtime) values ('" + this.txt_title.Text.Trim() + "'," + this.txt_order.Text.Trim() + ",'" + this.txt_content.Value + "','" + pic + "'," + this.ddl_lg.SelectedValue.Trim() + "," + this.ddl_type.SelectedValue + "," + this.ddl_leixing.SelectedValue + "," + this.txt_clickcount.Text.Trim() + ",'" + this.txt_date.Text.Trim() + "')";
            if (SQLServerHelper.execNonQuery(strsql))
            {
                Response.Redirect("fuwulist.aspx");
            }
        }


    }

    protected void ddl_type_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddl_leixing.Items.Clear();
        if (ddl_type.SelectedValue != "")
        {
            DataTable dt = SQLServerHelper.ExecuteTable("select ID,sname from TB_FuWuClass where fid  = " + ddl_type.SelectedValue + "");
            if (dt != null && dt.Rows.Count > 0)
            {

                this.ddl_leixing.DataSource = dt;
                this.ddl_leixing.DataTextField = "sname";
                this.ddl_leixing.DataValueField = "ID";
                this.ddl_leixing.DataBind();
            }
            else
            {
                this.ddl_leixing.Items.Add(new ListItem("不限", "0"));
            }
        }
    }
}

#line default
#line hidden