예제 #1
0
    protected void btn_edit_Click(object sender, EventArgs e)
    {
        try
        {
            NewsGroup    newsgroup    = ReceiveHtml();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            newsgroupBSO.UpdateNewsGroup(newsgroup);



            //Add NewsCate
            NewsCateBSO _newscateBSO = new NewsCateBSO();
            DataTable   tblNewsCate  = _newscateBSO.GetNewsCateByNewsGroupID(newsgroup.NewsGroupID);
            if (tblNewsCate.Rows.Count > 0)
            {
                _newscateBSO.DeleteNewsCatebyNewsID(newsgroup.NewsGroupID);
            }

            add_NewsCate(newsgroup.NewsGroupID);

            NewsLogBSO newsLogBSO = new NewsLogBSO();
            NewsLog    _newsLog   = newsLogBSO.GetNewsLog(newsgroup, Session["Admin_UserName"].ToString(), DateTime.Now, 0);
            int        _newsLogID = newsLogBSO.CreateNewsLog(_newsLog);

            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>";
            initControl(newsgroup.NewsGroupID);
            ViewNewsLog(newsgroup.NewsGroupID);
            AspNetCache.Reset();
            //ViewCateNews(Convert.ToInt32(hddGroup.Value));
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #2
0
    protected void btn_add_Click_more(object sender, EventArgs e)
    {
        try
        {
            NewsGroup    newsgroup    = ReceiveHtml();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            int          _newsgroupID = newsgroupBSO.CreateNewsGroupGet(newsgroup);



            //Add NewsCate
            add_NewsCate(_newsgroupID);

            NewsLogBSO newsLogBSO = new NewsLogBSO();
            NewsLog    _newsLog   = newsLogBSO.GetNewsLog(newsgroup, Session["Admin_UserName"].ToString(), DateTime.Now, 0);
            int        _newsLogID = newsLogBSO.CreateNewsLog(_newsLog);

            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            AspNetCache.Reset();
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #3
0
    protected void btn_add_Click(object sender, EventArgs e)
    {
        try
        {
            NewsGroup    newsgroup    = ReceiveHtml();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            int          _newsgroupID = newsgroupBSO.CreateNewsGroupGet(newsgroup);



            add_NewsCate(_newsgroupID);

            NewsLogBSO newsLogBSO = new NewsLogBSO();
            NewsLog    _newsLog   = newsLogBSO.GetNewsLog(newsgroup, Session["Admin_UserName"].ToString(), DateTime.Now, 0);
            int        _newsLogID = newsLogBSO.CreateNewsLog(_newsLog);

            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            initControl(_newsgroupID);
            AspNetCache.Reset();
            ViewNewsLog(_newsgroupID);
            //Response.Redirect("~/Admin/Group/listnewsgroup/" + hddGroup.Value + "/Default.aspx");
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }
예제 #4
0
    protected void btn_add_Click(object sender, EventArgs e)
    {
        try
        {
            NewsGroup    newsgroup    = ReceiveHtml();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();

            // MessageBox.Show();

            //if (Tool.CountWords2(Tool.StripTagsCharArray(newsgroup.ShortDescribe)) > 60)
            //{
            //    String csname = "PopupScript";
            //    Type cstype = this.GetType();
            //    ClientScriptManager cs = Page.ClientScript;
            //    if (!cs.IsStartupScriptRegistered(cstype, csname))
            //    {
            //        String cstext = "Confirmation();";
            //        cs.RegisterStartupScript(cstype, csname, cstext, true);
            //    }
            //    if (hnd.Value != "")
            //    {

            int _newsgroupID = newsgroupBSO.CreateNewsGroupGet(newsgroup);



            //Add NewsCate

            add_NewsCate(_newsgroupID);

            NewsLogBSO newsLogBSO = new NewsLogBSO();
            NewsLog    _newsLog   = newsLogBSO.GetNewsLog(newsgroup, Session["Admin_UserName"].ToString(), DateTime.Now, 0);
            int        _newsLogID = newsLogBSO.CreateNewsLog(_newsLog);

            clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>";
            initControl(_newsgroupID);
            AspNetCache.Reset();
            ViewNewsLog(_newsgroupID);
            //Response.Redirect("~/Admin/Group/listnewsgroup/" + hddGroup.Value + "/Default.aspx");
        }
        catch (Exception ex)
        {
            clientview.Text = ex.Message.ToString();
        }
    }