public static string OperateRecords(string ids, int op)
        {
            string[] array = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            using (BLLNewsType bll = new BLLNewsType())
            {
                foreach (string id in array)
                {
                    switch (op)
                    {
                    case 7:

                        using (BLLNewsDetail blls1 = new BLLNewsDetail())
                        {
                            SearchNewsDetail con3 = new SearchNewsDetail();
                            con3.NewsTypeID = Convert.ToInt32(id);

                            if (blls1.GetList(con3).Count > 0)
                            {
                                return("此新闻类型下有相应的新闻,不能删除!");
                            }
                        }

                        bll.Delete(id);
                        break;
                    }
                }

                if (bll.IsFail)
                {
                    return(ExceptionManager.GetErrorMsg(bll.DevNetException));
                }
            }
            return(string.Empty);
        }
示例#2
0
        private void bindList()
        {
            SearchNewsDetail con = new SearchNewsDetail();

            if (ddlNewsType.SelectedValue != "")
            {
                con.NewsTypeID = Convert.ToInt32(ddlNewsType.SelectedValue);
            }
            if (rbtnIsChinese.Checked == true)
            {
                con.IsEnglish = 1;
            }
            else if (rbtnIsEnglish.Checked == true)
            {
                con.IsEnglish = 2;
            }
            Pagination pagina = new Pagination(pager.PageIndex, pager.PageSize, 0);

            using (BLLNewsDetail bll = new BLLNewsDetail())
            {
                List <NewsDetail> lists = bll.GetPageList(con, pagina);

                pager.RecordCount = pagina.RecordCount;
                pager.PageCount   = pagina.PageCount;

                grid_friendlink.DataSource = lists;
                grid_friendlink.DataBind();
            }
        }
示例#3
0
        private void setnews()
        {
            SearchNewsDetail snt = new SearchNewsDetail();

            snt.IsEnglish = 1;

            Pagination pagination = new DevNet.Common.Pagination(1, 6, 0);

            using (BLLNewsDetail bll = new BLLNewsDetail())
            {
                List <NewsDetail> lists = bll.GetPageList(snt, pagination);

                rptNews.DataSource = lists;
                rptNews.DataBind();
            }
        }
示例#4
0
        /// <summary>
        /// 加载新闻
        /// </summary>
        private void setnews()
        {
            SearchNewsDetail snt = new SearchNewsDetail();

            snt.IsEnglish = 1;
            if (type == 0)
            {
            }
            else
            {
                snt.NewsTypeID = type;
            }
            Pagination pagination = new DevNet.Common.Pagination(pager.PageIndex, pager.PageSize, 0);

            using (BLLNewsDetail bll = new BLLNewsDetail())
            {
                List <NewsDetail> lists = bll.GetPageList(snt, pagination);
                pager.RecordCount  = pagination.RecordCount;
                rptNews.DataSource = lists;
                rptNews.DataBind();
            }
        }
示例#5
0
        private void NewsBind()
        {
            SearchNewsDetail snt = new SearchNewsDetail();

            using (BLLNewsDetail bll = new BLLNewsDetail())
            {
                snt.IsEnglish = 1;
                List <NewsDetail> nd = bll.GetTopList(snt);
                if (nd != null)
                {
                    if (nd.Count >= 1)
                    {
                        //    newsFirTitle.Text = GetStrByByteLength(nd[0].NewsTitle, 50, true);
                        //    newsFirText.Text = DelHTML(nd[0].NewsContent, 100);
                        //    newsFirTime1.Text = Convert.ToDateTime(nd[0].AddTime).ToString("yyy-MM");
                        //    newsFirTime2.Text = Convert.ToDateTime(nd[0].AddTime).ToString("dd");
                        //    Session["newsFirid"] = nd[0].ID;
                        //}
                        //if (nd.Count >= 2)
                        //{
                        //    newsSecTitle.Text = GetStrByByteLength(nd[1].NewsTitle, 50, true);
                        //    newsSecText.Text = DelHTML(nd[1].NewsContent, 100);
                        //    newsSecTime1.Text = Convert.ToDateTime(nd[1].AddTime).ToString("yyy-MM");
                        //    newsSecTime2.Text = Convert.ToDateTime(nd[1].AddTime).ToString("dd");
                        //    Session["newsSecid"] = nd[1].ID;
                        //}
                        //if (nd.Count >= 3)
                        //{
                        //    newsThrTitle.Text = GetStrByByteLength(nd[2].NewsTitle, 50, true);
                        //    newsThrText.Text = DelHTML(nd[2].NewsContent, 100);
                        //    newsThrTime1.Text = Convert.ToDateTime(nd[2].AddTime).ToString("yyy-MM");
                        //    newsThrTime2.Text = Convert.ToDateTime(nd[2].AddTime).ToString("dd");
                        //    Session["newsThrid"] = nd[2].ID;
                    }
                }
            }
        }