コード例 #1
0
ファイル: News.aspx.cs プロジェクト: makmen/ASP.NET
        protected void ViewAll()
        {
            Mode  = "ViewAll";
            Limit = 5;
            string str  = Request.QueryString["p"];
            int    page = 1;

            if (!string.IsNullOrEmpty(str))
            {
                Int32.TryParse(str, out page);
                if (page == 0)
                {
                    page = 1;
                }
            }
            ListNews = GlobalVariables.Link.GetNews(Limit, page);
            foreach (DbLink.News news in ListNews)
            {
                if (news.Content.Length > 400)
                {
                    news.Content = news.Content.Substring(0, 400);
                }
            }
            pagging();
            Repeter.DataSource = ListNews;
            Repeter.DataBind();
        }
コード例 #2
0
    private void LoadData()
    {
        string solution = Convert.ToString(Request.QueryString[0]);
        BLLCollection <Solution_mst> col = new BLLCollection <Solution_mst>();


        if (solution == "")
        {
            col = ObjSolution.Get_All();
        }
        else
        {
            string kewords = solution;
            col = ObjSolution.Get_SearchSolution_All(kewords);
        }


        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource       = col;
        pgitems.AllowPaging      = true;
        pgitems.PageSize         = 5;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPages.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i < pgitems.PageCount; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPages.Visible    = true;
            rptPages.DataSource = pages;

            rptPages.DataBind();
        }
        else
        {
            rptPages.Visible = false;
        }

        Repeter.DataSource = pgitems;
        Repeter.DataBind();
    }
コード例 #3
0
    //protected void lnkdelete_Click(object sender, EventArgs e)
    //{
    //    string SolutionId = "";
    //    foreach (RepeaterItem gv in Repeter.Items)
    //    {
    //        string gvIDs;

    //        int FlagStatus = 0;
    //        // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row
    //        CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec");
    //        // Get the Site Id from variable of Label type declare in GridView of grdvwSite
    //        gvIDs = ((Label)gv.FindControl("SiteID")).Text.ToString();
    //        // Check if gvIDs is not null
    //        if (gvIDs != "")
    //        {


    //            if (deleteChkBxItem.Checked)
    //            {
    //                SolutionId = SolutionId + Convert.ToInt16(gvIDs) + ",";

    //            }



    //        }

    //    }



    //     string[] str = SolutionId.Split(new char[] { ',' });
    //        foreach (string s in str)
    //        {
    //            if (s == "")
    //            {
    //                break;
    //            }
    //            int solid = Convert.ToInt16(s);
    //            Objsolutioncreator.Delete(solid);
    //            ObjSolutionKeyword.Delete(solid);
    //            ObjSolution.Delete(solid);
    //        }

    //        Response.Redirect("~/KEDB/ViewSolution.aspx");


    //}



    private void LoadDataForFilterParameter()
    {
        BLLCollection <Solution_mst> col = new BLLCollection <Solution_mst>();
        string filterid = drpfilter.SelectedValue;

        col = ObjSolution.Get_All_By_Filterid(filterid);



        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource       = col;
        pgitems.AllowPaging      = true;
        pgitems.PageSize         = 5;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPages.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i < pgitems.PageCount; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPages.Visible    = true;
            rptPages.DataSource = pages;

            rptPages.DataBind();
        }
        else
        {
            rptPages.Visible = false;
        }

        Repeter.DataSource = pgitems;
        Repeter.DataBind();
    }