コード例 #1
0
        public NewsPage()
        {
            InitializeComponent();

            BindingContext = new NewsViewModel();
            NewsListView.BeginRefresh();
        }
コード例 #2
0
        private void BindZhanbao()
        {
            DataTable dt = BLL.ZhanbaoManager.SelectAll();

            if (dt != null && dt.Rows.Count != 0)
            {
                NewsListView.DataSource = dt;
                NewsListView.DataBind();
            }
        }
コード例 #3
0
ファイル: News.cs プロジェクト: MathWave/CSMC
        public News() : base()
        {
            Title = "Новости";
            bool       success = true;
            string     html    = string.Empty;
            List <New> list    = new List <New>();

            try
            {
                using (WebClient wc = new WebClient())
                {
                    html = wc.DownloadString("https://cs.hse.ru/big-data/csmc/");
                }
                string[] info = html.Split(new string[] { "post__content" }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 1; i < info.Length; i++)
                {
                    string[] spl = info[i].Split(new char[] { '>', '<' }, StringSplitOptions.RemoveEmptyEntries);
                    string   im  = "";
                    try
                    {
                        im = spl.Length > 9 ? "http://hse.ru" + spl[9].Split('\"')[1] : "";
                    }
                    catch
                    {
                        im = "white.jpg";
                    }
                    New n = new New
                    {
                        Text  = spl[3],
                        Image = im,
                        Link  = spl[2].Split('\"')[3]
                    };
                    list.Add(n);
                }
            }
            catch
            { success = false; }
            if (success)
            {
                SerializationInfo.SerializeNews(list);
                App.NewsDB = list;
            }
            Content = new NewsListView(App.NewsDB);
        }
コード例 #4
0
        private void UpdateList(IEnumerable <string> news)
        {
            NewsListView.Items.Clear();
            NewsListView.BeginUpdate();

            foreach (var post in news)
            {
                var jsonList = JsonConvert.DeserializeObject <Post>(post);

                var item = new ListViewItem(jsonList.title)
                {
                    Tag = jsonList.body
                };

                NewsListView.Items.Add(item);
            }

            NewsListView.EndUpdate();
        }
コード例 #5
0
 /// <summary>
 /// 刷新
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void RefreshButton_Click(object sender, RoutedEventArgs e)
 {
     if (pivotRanks.SelectedIndex == 0)  //48小时阅读
     {
         _list_48Views.DoRefresh();
         await View48ListView.LoadMoreItemsAsync();
     }
     else if (pivotRanks.SelectedIndex == 1)  //10天推荐
     {
         _list_10Diggs.DoRefresh();
         await Digg10ListView.LoadMoreItemsAsync();
     }
     else if (pivotRanks.SelectedIndex == 2)  //推荐新闻
     {
         _list_newsDiggs.DoRefresh();
         await NewsListView.LoadMoreItemsAsync();
     }
     else //推荐博主
     {
         _list_blogerDiggs.DoRefresh();
         await BlogerGridView.LoadMoreItemsAsync();
     }
 }
コード例 #6
0
ファイル: Publications.cs プロジェクト: MathWave/CSMC
        public Publications()
        {
            Title = "Публикации";
            string     html    = string.Empty;
            List <New> list    = new List <New>();
            bool       success = true;

            try
            {
                using (WebClient wc = new WebClient())
                {
                    html = wc.DownloadString("https://cs.hse.ru/big-data/csmc/publications?search=15a2d174e97e87863dd28c8cfacb3ee1");
                }
                string[] data = html.Split(new string[] { "pubs-item__title" }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 1; i < data.Length; i++)
                {
                    string[] spl = data[i].Split(new char[] { '<', '>' }, StringSplitOptions.RemoveEmptyEntries);
                    New      n   = new New
                    {
                        Text = spl[2],
                        Link = spl[1].Split('\"')[3]
                    };
                    list.Add(n);
                }
            }
            catch
            {
                success = false;
            }
            if (success)
            {
                SerializationInfo.SerializePublications(list);
                App.PublicationsDB = list;
            }
            Content = new NewsListView(App.PublicationsDB);
        }
コード例 #7
0
ファイル: NewsPage.xaml.cs プロジェクト: zjlgdx/CNBlogs.UWP
 /// <summary>
 /// 刷新
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void RefreshButton_Click(object sender, RoutedEventArgs e)
 {
     _list_news.DoRefresh();
     await NewsListView.LoadMoreItemsAsync();
 }
コード例 #8
0
ファイル: SysinfoQ.aspx.cs プロジェクト: mdsJimmy/CSP
    private void QueryList()
    {
        string strAppType   = ""; //發佈對像
        string strNewsKind  = ""; //種類
        string strStartDate = ""; //上架起始時間
        string strEndDate   = ""; //上架結束時間

        if (!string.IsNullOrEmpty(MDS.Utility.NUtility.trimBad(Request.QueryString["_selAppType"])))
        {
            strAppType = MDS.Utility.NUtility.trimBad(Request.QueryString["_selAppType"]);
        }
        if (!string.IsNullOrEmpty(MDS.Utility.NUtility.trimBad(Request.QueryString["_selNewsKind"])))
        {
            strNewsKind = MDS.Utility.NUtility.trimBad(Request.QueryString["_selNewsKind"]);
        }
        if (!string.IsNullOrEmpty(MDS.Utility.NUtility.trimBad(Request.QueryString["_txtStartDate"])))
        {
            strStartDate = MDS.Utility.NUtility.trimBad(Request.QueryString["_txtStartDate"]);
        }
        if (!string.IsNullOrEmpty(MDS.Utility.NUtility.trimBad(Request.QueryString["_txtEndDate"])))
        {
            strEndDate = MDS.Utility.NUtility.trimBad(Request.QueryString["_txtEndDate"]);
        }


        if (NewsListView == null)
        {
            ContentPlaceHolder MySecondContent = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
            NewsListView = MySecondContent.FindControl("NewsListView") as ASP.dmscontrol_olistview_ascx;
            //StrSearch = MySecondContent.FindControl("StrSearch") as System.Web.UI.HtmlControls.HtmlInputText;
        }
        if (NewsListView != null)
        {
            //加入欄位Start
            NewsListView.AddCol("代碼 ", "CKEY", "CENTER", "20");
            NewsListView.AddCol("說明", "CNOTE", "LEFT", "20%");
            NewsListView.AddCol("資料內容", "CVALUE", "LEFT", "50%");
            NewsListView.AddCol("顯示位置", "CSTATUSS", "CENTER", "10%");


            //NewsListView.AddCol("提供 APP 使用", "APPLY44", "CENTER", "10%");
            //NewsListView.AddCol("備註", "MEMO", "LEFT", "15%");
            //NewsListView.AddCol("下架日期", "E_DATE", "LEFT", "10%");
            ////BosomServiceList.AddCol("資料狀態", "status", "LEFT");
            //NewsListView.AddCol("最後更新日期", "LDATA", "LEFT", "20%");

            //加入欄位End

            //設定Key值欄位
            NewsListView.DataKeyNames = "CKEY"; //Key以,隔開

            //設定是否顯示CheckBox(預設是true);
            //BosomServiceList.IsUseCheckBox = false;

            StringBuilder sbSQL = new StringBuilder();
            //設定SQL
            sbSQL.Append(" select CKEY, CVALUE, CNOTE, CSTATUS, APPLY4, " +
                         " (case when CKEY = \'MIP_AD_02\' then \'系統值不可修改\' " +
                         " when CKEY = \'CUSTOMER_MAIL_TIME\'  then \'系統值不可修改\' " +
                         " when CKEY = \'MIP_TOLO_CNT_02\'  then \'系統值不可修改\' " +
                         " when CKEY = \'MIP_TOLO_CNT_01\'  then \'系統值不可修改\' " +
                         " when CKEY = \'YL0132A\'  then \'系統值不可修改\' " +
                         " when CKEY = \'MIP_AD_01\'  then \'系統值不可修改\' " +
                         " else \'非系統值可修改\' end) as MEMO, " +
                         " ( case when CSTATUS ='M' then '<置中>' when CSTATUS ='L' then '<左'  else \'右>\' end) CSTATUSS, " +
                         " ( case when APPLY4 = \'1\' then \'否\' else \'是\' end) APPLY44 " +
                         " from MIP_SYS_INFO order by CKEY ASC; "
                         );

            //發布對象
            //if (!string.IsNullOrEmpty(strAppType) && !strAppType.Equals("0"))
            //{
            //    sbSQL.Append("AND n.CKEY = '" + strAppType + "'");
            //}

            ////商品類別
            //if (!string.IsNullOrEmpty(strNewsKind))
            //{
            //    sbSQL.Append("AND n.CVALUE = '" + strNewsKind + "'");
            //}

            ////上架時間
            //if (!string.IsNullOrEmpty(strStartDate))
            //{
            //    sbSQL.Append("AND n.S_DATE >= CONVERT(datetime, '" + strStartDate.Replace("/", "") + " 00:00:00') ");
            //    _CreateStartDate = strStartDate;
            //}

            ////下架時間
            //if (!string.IsNullOrEmpty(strEndDate))
            //{
            //    sbSQL.Append("AND n.S_DATE <= CONVERT(datetime, '" + strEndDate.Replace("/", "") + " 23:59:59') ");
            //    _CreateEndDate = strEndDate;
            //}

            //sbSQL.Append(" ORDER BY n.APP_TYPE,n.BULL_ID,SORT ");

            //取得SQL;
            NewsListView.SelectString = sbSQL.ToString();
            string showSql = sbSQL.ToString();
            Debug.Write(showSql);

            //設定每筆資料按下去的Javascript function
            NewsListView.OnClickExecFunc = "DoEdt()";

            //設定每頁筆數
            NewsListView.PageSize = 26;

            //接來自Request的排序欄位、排序方向、目前頁數
            ListViewSortKey       = Request.Params["ListViewSortKey"];
            ListViewSortDirection = Request.Params["ListViewSortDirection"];
            PageNo = Request.Params["PageNo"];

            //設定排序欄位及方向
            if (!string.IsNullOrEmpty(ListViewSortKey) && !string.IsNullOrEmpty(ListViewSortDirection))
            {
                NewsListView.ListViewSortKey       = ListViewSortKey;
                NewsListView.ListViewSortDirection = (SortDirection)Enum.Parse(typeof(SortDirection), ListViewSortDirection);
            }

            //設定目前頁數
            if (!string.IsNullOrEmpty(PageNo))
            {
                NewsListView.PageNo = int.Parse(PageNo);
            }
        }
    }
コード例 #9
0
    private void QueryList()
    {
        string selSystemModuled = "";



        if (!string.IsNullOrEmpty(Request.QueryString["_selSystemModule"]))
        {
            selSystemModuled = MDS.Utility.NUtility.trimBad(Request.QueryString["_selSystemModule"]);
        }


        if (NewsListView == null)
        {
            ContentPlaceHolder MySecondContent = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
            NewsListView = MySecondContent.FindControl("NewsListView") as ASP.dmscontrol_olistview_ascx;
        }

        if (NewsListView != null)
        {
            //加入欄位Start
            NewsListView.AddCol("功能ID", "SysFuncID", "LEFT", "30%");
            NewsListView.AddCol("系統模組名稱", "ModuleDesc", "CENTER", "10%");
            NewsListView.AddCol("功能名稱", "FunctionDesc", "CENTER", "20%");
            NewsListView.AddCol("Uri", "PageLink", "LEFT", "10%");
            NewsListView.AddCol("圖片", "Pic", "CENTER", "8%");
            NewsListView.AddCol("排序", "fOrder", "CENTER", "2%");
            NewsListView.AddCol("顯示", "Display", "CENTER", "2%");

            //加入欄位End

            //設定Key值欄位
            NewsListView.DataKeyNames = "SysFuncID"; //Key以,隔開

            //設定是否顯示CheckBox(預設是true);
            //BosomServiceList.IsUseCheckBox = false;

            StringBuilder sbSQL = new StringBuilder();
            //設定SQL
            sbSQL.Append("  select f.SysFuncID , f.FunctionDesc, f.PageLink, f.pic , f.SysModID, m.ModuleDesc , m.iOrder , f.iOrder as fOrder , m.isDefault, f.iDisplay as Display from SystemModule m  FULL OUTER JOIN  SystemFunction f on m.SysModID = f.SysModID ");



            //模組
            if (!string.IsNullOrEmpty(selSystemModuled))
            {
                sbSQL.Append("  where f.SysModID=@SysModID ");

                NewsListView.putQueryParameter("SysModID", selSystemModuled);
            }

            sbSQL.Append(" order by ModuleDesc , f.iOrder");

            //設定SQL;
            NewsListView.SelectString = sbSQL.ToString();
            //完成參數值填充
            NewsListView.prepareStatement();


            string showSql = sbSQL.ToString();
            Debug.Write(showSql);

            //設定每筆資料按下去的Javascript function
            NewsListView.OnClickExecFunc = "DoEdt()";

            //設定每頁筆數
            NewsListView.PageSize = 26;

            //接來自Request的排序欄位、排序方向、目前頁數
            ListViewSortKey       = Request.Params["ListViewSortKey"];
            ListViewSortDirection = Request.Params["ListViewSortDirection"];
            PageNo = Request.Params["PageNo"];

            //設定排序欄位及方向
            if (!string.IsNullOrEmpty(ListViewSortKey) && !string.IsNullOrEmpty(ListViewSortDirection))
            {
                NewsListView.ListViewSortKey       = ListViewSortKey;
                NewsListView.ListViewSortDirection = (SortDirection)Enum.Parse(typeof(SortDirection), ListViewSortDirection);
            }

            //設定目前頁數
            if (!string.IsNullOrEmpty(PageNo))
            {
                NewsListView.PageNo = int.Parse(PageNo);
            }
        }
    }