Ejemplo n.º 1
0
        private void BindData()
        {
            int _id = 0;

            if (Int32.TryParse(Request.QueryString["ID"], out _id))
            {
                DataTable _obj = NewsEditHelper.GetCrawlerNews(_id);

                if (_obj != null && _obj.Rows.Count > 0)
                {
                    DataRow row = _obj.Rows[0];

                    ltrTitle.Text = row["News_Title"].ToString();
                    ltrSapo.Text  = row["News_InitContent"].ToString();

                    long NewsID = Convert.ToInt64(NewsHelper.GenNewsID());

                    //NewsEditHelper.CreateNews(NewsID, 0, string.Empty, row["News_Title"].ToString(), string.Empty, "Theo " + row["SourceName"], row["News_InitContent"].ToString(), row["News_Content"].ToString(), string.Empty, false, 0, 0, string.Empty, string.Empty, string.Empty, DateTime.Now, false, false, 0, string.Empty, string.Empty, string.Empty, false, string.Empty, string.Empty, row["News_Source"].ToString(), 0, string.Empty, string.Empty);

                    //NewsEditHelper.UpdateCrawlerStatus(_id);

                    //Response.Redirect("/office/add,templist/" + NewsID + ".aspx");
                }
            }
        }
        protected void grdList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("Copy"))
            {
                int _id = Convert.ToInt32(e.CommandArgument);

                DataTable _obj = NewsEditHelper.GetCrawlerNews(_id);

                if (_obj != null && _obj.Rows.Count > 0)
                {
                    DataRow row    = _obj.Rows[0];
                    long    NewsID = Convert.ToInt64(NewsHelper.GenNewsID());
                    NewsEditHelper.CreateNews(NewsID, 0, string.Empty, row["News_Title"].ToString(), string.Empty, "Theo " + row["SourceName"], row["News_InitContent"].ToString(), row["News_Content"].ToString(), HttpContext.Current.User.Identity.Name, false, 0, 0, string.Empty, string.Empty, string.Empty, DateTime.Now, false, false, 0, string.Empty, string.Empty, string.Empty, false, string.Empty, string.Empty, row["News_Source"].ToString(), 0, string.Empty, string.Empty);

                    NewsEditHelper.UpdateCrawlerStatus(_id);

                    Response.Redirect("/office/add,templist/" + NewsID + ".aspx");
                }
                else
                {
                    Response.Redirect("/office/crawler.aspx");
                }
            }
        }