protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string   strContent = Request.Form["t_contents"].ToString();
        NewsInfo news       = new NewsInfo();

        news.N_Title   = txtTitle.Text;
        news.N_From    = txtFrom.Text;
        news.N_Content = PubClass.Tool.CheckStr(strContent);
        news.N_ImgPath = "";
        news.N_ImgView = "";
        news.N_HotIco  = "";
        news.N_PicIco  = "";
        news.N_Time    = txtTime.Text;
        news.N_TID     = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]);
        if (ViewState["strAction"].ToString() == "update")
        {
            news.N_ID = Convert.ToInt32(ViewState["nid"]);
            NewsInfoService.Update_NewsInfoWithTime(news);
        }
        else if (ViewState["strAction"].ToString() == "add")
        {
            NewsInfoService.Insert_NewsInfoWithTime(news);
        }
        CommonFunction.AlertAndRedirect(Literal1, "操作成功", "CommonNewsMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        NewsInfo news = new NewsInfo();

        news.N_Title   = txtTitle.Text.Trim();
        news.N_From    = "河南省高速公路路警联合指挥中心";
        news.N_Content = txtContent.Text;
        news.N_ImgPath = "";
        news.N_ImgView = "";
        news.N_HotIco  = "";
        news.N_PicIco  = "";
        news.N_Time    = txtTime.Text;
        news.N_TID     = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]);
        if (ViewState["strAction"].ToString() == "update")
        {
            news.N_ID = Convert.ToInt32(ViewState["nid"]);
            NewsInfoService.Update_NewsInfoWithTime(news);
        }
        else if (ViewState["strAction"].ToString() == "add")
        {
            NewsInfoService.Insert_NewsInfoWithTime(news);
        }
        if (Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]) == 80)
        {
            CommonFunction.AlertAndRedirect(Literal1, "操作成功", "CurrentRoadContion.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
        }
        else if (Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]) == 81)
        {
            CommonFunction.AlertAndRedirect(Literal1, "操作成功", "HistoryRoadCondition.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
        }
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CommonFunction.isLoginCheck();
         ViewState["HTML"]      = "";
         ViewState["strAction"] = Request.QueryString["action"];
         int tid = Convert.ToInt32(Request.QueryString["tid"]);
         ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(tid);
         if (Request.QueryString["nid"] != null)
         {
             int nid = Convert.ToInt32(Request.QueryString["nid"]);
             ViewState["nid"] = nid;
             DataTable dt = NewsInfoService.Get_NewsInfo(nid);
             txtTitle.Text     = dt.Rows[0]["N_Title"].ToString();
             txtTime.Text      = Convert.ToDateTime(dt.Rows[0]["N_Time"].ToString()).ToShortDateString();
             txtFrom.Text      = dt.Rows[0]["N_From"].ToString();
             ViewState["HTML"] = dt.Rows[0]["N_ImgPath"].ToString();
         }
         else
         {
             txtTime.Text = DateTime.Now.ToShortDateString();
             txtFrom.Text = "本站原创";
         }
     }
 }
Пример #4
0
        //protected void btnUpload_Click(object sender, EventArgs e)
        //{
        //    if (FileUpload.HasFile)//判断上传框是否有文件
        //    {
        //        bool FileOK = false;//初始化文件格式是否正确
        //        string FileExtension = System.IO.Path.GetExtension(FileUpload.FileName.ToLower());
        //        string[] allowedExtension = { ".jpg", ".jpeg", ".gif", ".png", ".bmp" };//设置允许上传的文件类型
        //        for (int i = 0; i < allowedExtension.Length; i++)
        //        {
        //            if (FileExtension == allowedExtension[i])
        //            {
        //                FileOK = true;
        //            }
        //        }
        //        if (FileOK)//文件类型正确
        //        {
        //            try
        //            {
        //                string SavePath = Server.MapPath("~/images/News/");//指定上传文件在服务器上的保存路径
        //                if (!System.IO.Directory.Exists(SavePath))//检查服务器上是否存在这个物理路径,如果不存在则创建
        //                {
        //                    System.IO.Directory.CreateDirectory(SavePath);
        //                }
        //                SavePath = SavePath + "\\" + FileUpload.FileName;
        //                FileUpload.SaveAs(SavePath);
        //                Session["DocAddr"] = "UploadFiles\\Documents\\" + Session["UserName"] + "\\" + FileUpload.FileName;
        //                Response.Write("<script>alert('上传成功');</script>");
        //                Label2.Text = "images\\News\\" + FileUpload.FileName;
        //                this.btnUpload.Enabled = false;
        //            }
        //            catch (Exception ex)
        //            {
        //                Response.Write("<script>alert('上传失败');</script>");
        //            }
        //        }
        //        else
        //        {
        //            Response.Write("<script>alert('上传的文件格式不正确,请重新选择!');</script>");
        //        }
        //    }
        //    else
        //    {
        //        Response.Write("<script>alert('请选择需要上传的文件!');</script>");
        //    }
        //}
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                //if (Label2.Text.Trim() == "")
                //{
                //    Response.Write("<script>alert('照片不能为空!')</script>");
                //}
                //else
                //{
                NewsInfo news = new NewsInfo();
                news.NewsID = Convert.ToInt32(Request.QueryString["NewsID"]);
                //news.AssID = 1;
                news.NewsTitle   = txtTitle.Text.Trim();
                news.NewsContent = CKEditorControl1.Text.Trim();
                //news.NewsImages = Label2.Text;
                news.NewsTime = DateTime.Now;
                int result = NewsInfoService.Insert(news);
                if (result >= 1)
                {
                    Response.Write("<script>alert('发布成功!')</script>");
                }

                //}
            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('上传失败');</script> 原因是:" + ex);
            }
        }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TollStation station = (TollStation)Session["stationinfo"];
            this.Title = station.TS_Name + "门户网站首页";


            DataTable dtZQWH = NewsInfoService.Get_NewsViewList(station.TS_ID, 5, 6);
            rptZQWH.DataSource = dtZQWH;
            rptZQWH.DataBind();

            DataTable dtTZGG = NewsInfoService.Get_NewsViewList(station.TS_ID, 2, 5);
            rptTZGG.DataSource = dtTZGG;
            rptTZGG.DataBind();

            DataTable dtZXDT = NewsInfoService.Get_NewsViewList(station.TS_ID, 1, 5);
            rptZXDT.DataSource = dtZXDT;
            rptZXDT.DataBind();

            DataTable dtRongYu = NewsInfoService.Get_NewsViewList(station.TS_ID, 3, 0);
            rptRongYu.DataSource = dtRongYu;
            rptRongYu.DataBind();

            DataTable dtFengCai = NewsInfoService.Get_NewsViewList(station.TS_ID, 6, 0);
            rptFengCai.DataSource = dtFengCai;
            rptFengCai.DataBind();

            DataTable dtFWZX = NewsInfoService.Get_NewsViewList(station.TS_ID, 4, 1);
            rptStar.DataSource = dtFWZX;
            rptStar.DataBind();
        }
    }
 public ResponseMessageWrap <int> DeleteById(long id)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = NewsInfoService.DeleteById(id)
     });
 }
 public ResponseMessageWrap <int> Update([FromBody] NewsInfo newsInfo)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = NewsInfoService.Update(newsInfo)
     });
 }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     FileFunction.DataToExcel(NewsInfoService.Get_NewsInfoViewList(21), new string[] { "编号", "标题", "内容" }, "数据导出报表", "1234567");
     //GridView1.DataSource = NewsInfoService.Get_NewsInfoViewList(21);
     //GridView1.DataBind();
     //GridView1.Columns[2].Visible = true;
 }
 public ResponseMessageWrap <int> Insert([FromBody] NewsInfo newsInfo)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = NewsInfoService.Insert(newsInfo)
     });
 }
Пример #10
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        if (ViewState["strAction"].ToString() == "add" || FileUploadHTML.HasFile)
        {
            string fileName = CommonFunction.Get_DynamicString() + FileUploadHTML.FileName;
            string filePath = Server.MapPath("~/workexpress/" + fileName);
            if (!CommonFunction.Is_FileUploadSuccessfully(FileUploadHTML, Literal1, filePath, new string[] { ".html", "htm", "shtml" }))
            {
                return;
            }
            ViewState["HTML"] = fileName;
        }

        NewsInfo news = new NewsInfo();

        news.N_Title   = txtTitle.Text;
        news.N_From    = txtFrom.Text;
        news.N_Content = "";
        news.N_ImgPath = ViewState["HTML"].ToString();
        news.N_ImgView = "";
        news.N_HotIco  = "";
        news.N_PicIco  = "";
        news.N_Time    = txtTime.Text;
        news.N_TID     = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]);
        if (ViewState["strAction"].ToString() == "update")
        {
            news.N_ID = Convert.ToInt32(ViewState["nid"]);
            NewsInfoService.Update_NewsInfoWithTime(news);
        }
        else if (ViewState["strAction"].ToString() == "add")
        {
            NewsInfoService.Insert_NewsInfoWithTime(news);
        }
        CommonFunction.AlertAndRedirect(Literal1, "操作成功", "WorkExpressMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
    }
Пример #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int tid = Convert.ToInt32(Request.QueryString["tid"]);

        ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(tid);
        ViewState["tid"]    = tid;
        binddata(tid);
    }
Пример #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int       nid    = Convert.ToInt32(Request.QueryString["nid"]);
         DataTable dtNews = NewsInfoService.Get_NewsInfoView(nid);
         ViewState["dtNews"] = dtNews;
     }
 }
Пример #13
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "delRecord")
     {
         int nid = Convert.ToInt32(e.CommandArgument);
         NewsInfoService.Delete_NewsInfo(nid);
         binddata(Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
     }
 }
Пример #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dtNews = NewsInfoService.Get_NewsView(Convert.ToInt32(Request.QueryString["nid"]));
         ViewState["dtNews"] = dtNews;
         RoadDepart depart = (RoadDepart)Session["roadinfo"];
         this.Title = dtNews.Rows[0]["N_Title"].ToString() + "-" + dtNews.Rows[0]["T_Name"].ToString() + "-" + depart.RD_Name + "门户网站";
     }
 }
Пример #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int id = Convert.ToInt32(Request.QueryString["id"].ToString());
         Table = NewsInfoService.Get_NewsInfo(id);
         this.Panel_img.Visible = Property.HaveImg(id);
         BindTitleAndMenu(id);
     }
 }
Пример #16
0
        private void BindNews()
        {
            DataTable dt = NewsInfoService.SelectTop(4);

            if (dt != null && dt.Rows.Count != 0)
            {
                ListView2.DataSource = dt;
                ListView2.DataBind();
            }
        }
Пример #17
0
 protected void LinkButton1_Command(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "rulenav")
     {
         int tid = Convert.ToInt32(e.CommandArgument);
         ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(tid);
         ViewState["tid"]    = tid;
         binddata(tid);
     }
 }
Пример #18
0
        private void BindAct()
        {
            DataTable dt = NewsInfoService.SelectAll();

            if (dt != null && dt.Rows.Count > 0)
            {
                ListView1.DataSource = dt;
                ListView1.DataBind();
            }
        }
Пример #19
0
    protected void BindPic(Repeater rpt, int ModuleID, int MessageCount)
    {
        DataTable dt = NewsInfoService.Get_TopAnyPicNews(ModuleID, MessageCount);

        if (dt.Rows.Count > 0)
        {
            rpt.DataSource = dt;
            rpt.DataBind();
        }
    }
Пример #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CommonFunction.isLoginCheck();
         int tid = Convert.ToInt32(Request.QueryString["tid"]);
         ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(tid);
         binddata(tid);
     }
 }
Пример #21
0
    protected void BindTextInfo(Repeater rpt, int ModuleID, int MessageCount)
    {
        DataTable dt = NewsInfoService.Get_TopNewsInfoViewList(ModuleID, MessageCount);

        if (dt.Rows.Count > 0)
        {
            rpt.DataSource = dt;
            rpt.DataBind();
        }
    }
Пример #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int year = DateTime.Now.Year;
         ViewState["year"] = year;
         binddata(64, year);
         ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(64);
     }
 }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string strContent = Request.Form["t_contents"].ToString();

        if (cboxPic.Checked)
        {
            if (ViewState["strAction"].ToString() == "add" && (!FUploadImg.HasFile || !FUploadView.HasFile))
            {
                CommonFunction.Alert(Literal1, "请上传缩略图和图片!");
                return;
            }
            string fileName  = CommonFunction.Get_DynamicString() + FUploadImg.FileName;
            string vfileName = CommonFunction.Get_DynamicString() + FUploadView.FileName;
            string filePath  = Server.MapPath("~/newsimages/" + fileName);
            string vfilePath = Server.MapPath("~/newsimages/" + vfileName);
            if (FUploadImg.HasFile)
            {
                if (!CommonFunction.Is_FileUploadSuccessfully(FUploadImg, Literal1, filePath, new string[] { ".gif", ".jpg", ".jpeg" }))
                {
                    return;
                }
                ViewState["ImgPath"] = fileName;
            }
            if (FUploadView.HasFile)
            {
                if (!CommonFunction.Is_FileUploadSuccessfully(FUploadView, Literal1, vfilePath, new string[] { ".gif", ".jpg", ".jpeg" }))
                {
                    return;
                }
                ViewState["ImgView"] = vfileName;
            }
            ViewState["ImgIco"] = "图片新闻";
        }
        NewsInfo news = new NewsInfo();

        news.N_Title   = txtTitle.Text;
        news.N_From    = txtFrom.Text;
        news.N_Content = PubClass.Tool.CheckStr(strContent);
        news.N_ImgPath = ViewState["ImgPath"].ToString();
        news.N_ImgView = ViewState["ImgView"].ToString();
        news.N_HotIco  = txtRemarkContent.Text.Trim();
        news.N_PicIco  = ViewState["ImgIco"].ToString();
        news.N_Time    = txtTime.Text;
        news.N_TID     = Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]);
        if (ViewState["strAction"].ToString() == "update")
        {
            news.N_ID = Convert.ToInt32(ViewState["nid"]);
            NewsInfoService.Update_NewsInfoWithTime(news);
        }
        else if (ViewState["strAction"].ToString() == "add")
        {
            NewsInfoService.Insert_NewsInfoWithTime(news);
        }
        CommonFunction.AlertAndRedirect(Literal1, "操作成功", "ImageTextRemarkNewsMgr.aspx?tid=" + Convert.ToInt32(((DataTable)ViewState["dtType"]).Rows[0]["T_ID"]));
    }
Пример #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int         nid     = Convert.ToInt32(Request.QueryString["nid"]);
         TollStation station = (TollStation)Session["stationinfo"];
         DataTable   dtNews  = NewsInfoService.Get_NewsView(nid);
         ViewState["dtNews"] = dtNews;
         this.Title          = dtNews.Rows[0]["N_Title"].ToString() + "-" + dtNews.Rows[0]["T_Name"].ToString() + "-" + station.TS_Name + "门户网站";
     }
 }
Пример #25
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            Button bt     = (Button)sender;
            int    newsid = Convert.ToInt32(((HiddenField)(bt.Parent.FindControl("HiddenField1"))).Value);

            if (NewsInfoService.DeleteAct(newsid) > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language='javascript' >alert('删除成功!');</script>");
                BindAct();
            }
        }
Пример #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindAction();

            //实时路况
            DataTable dtRoadConditon = NewsInfoService.Get_TopNewsInfoViewList("实时路况", 5);
            rptRoadCondition.DataSource = dtRoadConditon;
            rptRoadCondition.DataBind();
        }
    }
Пример #27
0
    /// <summary>
    /// 绑定标题和二级导航菜单
    /// </summary>
    protected void BindTitleAndMenu()
    {
        DataTable dt = NewsInfoService.Get_TypeInfoByTypeId(Convert.ToInt32(Request.QueryString["tid"]));

        if (dt != null)
        {
            ViewState["TName"]  = dt.Rows[0]["T_Name"];
            ViewState["Remark"] = dt.Rows[0]["T_Remark"];
            this.Page.Title     = ViewState["TName"] + "-" + ViewState["Remark"] + "-" + "河南省交通运输厅高速公路管理局门户网站";
            ViewState["tid"]    = Request.QueryString["tid"].ToString();
        }
    }
Пример #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["reportuser"] == null)
            {
                Response.Redirect("login.aspx");
            }

            rptReportList.DataSource = NewsInfoService.Get_NewsInfoViewList(6);
            rptReportList.DataBind();
        }
    }
Пример #29
0
    public static bool HaveImg(int oid)
    {
        bool      result = false;
        DataTable dt     = NewsInfoService.Get_NewsInfo(oid);

        foreach (DataRow dr in dt.Rows)
        {
            if (dr["N_ImgPath"].ToString() != "")
            {
                result = true;
            }
        }
        return(result);
    }
Пример #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //基层资讯
            DataTable dtJCZX = NewsInfoService.Get_TopNewsInfoViewList(109, 5);
            rptJCZX.DataSource = dtJCZX;
            rptJCZX.DataBind();

            //收费站文化
            DataTable dtSFZWH = NewsInfoService.Get_TopNewsInfoViewList(110, 5);
            rptSFZWH.DataSource = dtSFZWH;
            rptSFZWH.DataBind();

            //工作动态
            DataTable dtGZDT = NewsInfoService.Get_TopNewsInfoViewList(101, 9);
            rptGZDT.DataSource = dtGZDT;
            rptGZDT.DataBind();

            //规章制度
            DataTable dtZCFG = NewsInfoService.Get_TopNewsInfoViewList(100, 6);
            rptZCFG.DataSource = dtZCFG;
            rptZCFG.DataBind();

            //管理之窗
            DataTable dtGLZC = NewsInfoService.Get_TopNewsInfoViewList(102, 6);
            rptGLZC.DataSource = dtGLZC;
            rptGLZC.DataBind();

            //收费站风采
            DataTable dtStationMien = NewsInfoService.Get_TopNewsInfoViewList(111, 0);
            rptStationMien.DataSource = dtStationMien;
            rptStationMien.DataBind();

            //星级收费站
            DataTable dtStarStation = NewsInfoService.Get_TopNewsInfoViewList(103, 1);
            rptStarStation.DataSource = dtStarStation;
            rptStarStation.DataBind();

            //服务之星
            DataTable dtStationStar = NewsInfoService.Get_TopNewsInfoViewList(105, 1);
            rptStationStar.DataSource = dtStationStar;
            rptStationStar.DataBind();

            //站内公告
            DataTable dtZNGG = NewsInfoService.Get_TopNewsInfoViewList(104, 6);
            rptZNGG.DataSource = dtZNGG;
            rptZNGG.DataBind();
        }
    }