コード例 #1
0
        public void LoadCategoryDiv()
        {
            objService = new ServeAtDoorstepService();
            DataTable dt1 = objService.SelectAllCategory();

            string sCatInnerHtml = "";
            if (strcurrentLocation == "") strcurrentLocation = "Current Location";
            sCatInnerHtml = @"<br/>
                    <strong>
                        <label id='currentLocation' runat='server'>" + strcurrentLocation + "</label></strong>" +
                    "<small style='color: #C03;'>&nbsp;&nbsp;&nbsp;[Change]</small>" +
                    "<br/>" +
                    "<hr/><strong>Category</strong>";

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                sCatInnerHtml += "<br><a href='#' class='CatLink' onclick='Category(" + dt1.Rows[i]["CategoryID"].ToString() + ");'>" + dt1.Rows[i]["CategoryName"].ToString() + "</a>";
            }

            sCatInnerHtml += @"<hr>
                <strong>Service Type</strong><br>
                Security Equipment - Products<br>
                Tools - Machinery - Industrial<br>
                TV - DVD - Multimedia<br>
                Video Games - Consoles<br>
                <hr>
                <strong>Service Days</strong><br>
                Monday<br>
                Tuesday<br>
                Wednesday<br>
                Thursday<br>
                Friday<br>
                Saturday<br>
                Sunday<br>
                <hr>
                <strong>Others</strong><br>
                Everything Else<br>
                Home & Lifestyle<br><br>
                ";

            divCategory.InnerHtml = sCatInnerHtml;
        }
コード例 #2
0
 void LoadCategory()
 {
     ddlCategory.Items.Clear();
     objService = new ServeAtDoorstepService();
     DataTable dt1 = objService.SelectAllCategory();
     ListItem listItem = new ListItem();
     listItem.Text = "<Select Category>";
     listItem.Value = "0";
     ddlCategory.Items.Add(listItem);
     for (int i = 0; i < dt1.Rows.Count; i++)
     {
         listItem = new ListItem();
         listItem.Text = dt1.Rows[i]["CategoryName"].ToString();
         listItem.Value = dt1.Rows[i]["CategoryID"].ToString();
         ddlCategory.Items.Add(listItem);
     }
 }
コード例 #3
0
        void LoadCategory()
        {
            chkCateList.Items.Clear();
            objService = new ServeAtDoorstepService();
            DataTable dt1 = objService.SelectAllCategory();
            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                ListItem chkCat = new ListItem();
                chkCat.Text = "  "+dt1.Rows[i]["CategoryName"].ToString();
                chkCat.Value = dt1.Rows[i]["CategoryID"].ToString();
                chkCateList.Items.Add(chkCat);

            }
        }
コード例 #4
0
        void LoadCategory()
        {
            objService = new ServeAtDoorstepService();
            dt = objService.SelectAllCategory();

            if (dt.Rows.Count > PageSize)
                tblPaging.Visible = true;
            else
                tblPaging.Visible = false;

            if (dt.Rows.Count > 0)
            {
                if (tblPaging.Visible == true)
                {
                    // Setting viewstate for TotalRecords

                    LabelTotalRecords.Text = dt.Rows.Count.ToString();

                    // Setting viewstate for TotalPages

                    if (int.Parse(LabelTotalRecords.Text) % PageSize > 0)

                        // If page size is not exactly divisible by total records

                        ViewState["TotalPages"] = int.Parse(LabelTotalRecords.Text) / PageSize;

                    else

                        // If page is exactly divisible by total records

                        ViewState["TotalPages"] = int.Parse(LabelTotalRecords.Text) / PageSize - 1;

                    ViewState["dataTable"] = dt;

                    if (!object.Equals(dt, null))
                    {

                        BindList(ManagePaging(dt));

                    }
                }
                else
                {
                    DataList1.DataSource = dt;
                    DataList1.DataBind();
                }
            }
            else
                PagingRow.Visible = false;
        }