public void BindServiceGrid()
        {
            objService = new ServeAtDoorstepService();
            DataTable dtServ = objService.SelectAllService();

            if (dtServ.Rows.Count > 0)
            {
                //decimal dPageSize = (dt.Rows.Count / 4M);
                //GridView1.PagerSettings.PageButtonCount = Convert.ToInt32(Math.Floor(dPageSize));
                //GridView1.PageSize = Convert.ToInt32(Math.Ceiling(dPageSize));
            }
            gvService.DataSource = dtServ;
            gvService.DataBind();
        }
Beispiel #2
0
        void LoadAllServiceDiv()
        {
            objService = new ServeAtDoorstepService();
            DataTable dtServ = objService.SelectAllService();

            string sServiceInnerHtml = "";
            string strCategoryImagePath = "";

            //<div style="font-size:12px">description of the item description of the item description of the item description of the item</div>
            //<div><strong>$136.00</strong></div>
            //</div>";

            for (int i = 0; i < dtServ.Rows.Count; i++)
            {
                if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("BELT"))
                {
                    strCategoryImagePath = "image/category/BELT.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("CLOTH"))
                {
                    strCategoryImagePath = "image/category/CLOTH.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("COAT"))
                {
                    strCategoryImagePath = "image/category/COAT.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("ENGRAV"))
                {
                    strCategoryImagePath = "image/category/ENGRAVE.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("BAG"))
                {
                    strCategoryImagePath = "image/category/HANDBAG.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("KEY"))
                {
                    strCategoryImagePath = "image/category/KEYCUT.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("LUGGAGE"))
                {
                    strCategoryImagePath = "image/category/LUGGAGE.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("SHOE"))
                {
                    strCategoryImagePath = "image/category/SHOE.jpg";
                }
                else if (dtServ.Rows[i]["CategoryName"].ToString().ToUpper().Contains("WATCH"))
                {
                    strCategoryImagePath = "image/category/WATCH.jpg";
                }
                else
                {
                    strCategoryImagePath = "image/serveathome.jpg";
                }

                sServiceInnerHtml += @"<div id='HighlightItem2' style='padding:3px'>";
                sServiceInnerHtml += "<div><strong>" + dtServ.Rows[i]["ServiceName"].ToString() + "</strong></div>";
                sServiceInnerHtml += "<div class='bubbleInfo'>";
                sServiceInnerHtml += "<div><a href='ViewService.aspx?sID=" + dtServ.Rows[i]["ServiceID"].ToString() + "'><img class='trigger' src='" + strCategoryImagePath + "' width='125px' height='150px' /></a></div>";
                sServiceInnerHtml += @"<table id='dpop' class='popup'>
                                            <tbody><tr>
                                                <td id='topleft' class='corner'></td>
                                                <td class='top'></td>
                                                <td id='topright' class='corner'></td>
                                            </tr>

                                            <tr>
                                                <td class='left'></td>
                                                <td><table class='popup-contents'>
                                                    <tbody><tr>
                                                        <th>Category:</th>
                                                        <td>&nbsp;&nbsp;" + dtServ.Rows[i]["CategoryName"].ToString() + "</td>" +
                                                    "</tr>" +
                                                    "<tr>" +
                                                        "<th>Service Type:</th>" +
                                                        "<td>&nbsp;&nbsp;" + dtServ.Rows[i]["ServiceType"].ToString() + "</td>" +
                                                    "</tr>" +
                                                    "<tr>" +
                                                        "<th>Brand Name:</th>" +
                                                        "<td>&nbsp;&nbsp;" + dtServ.Rows[i]["BrandName"].ToString() + "</td>" +
                                                    "</tr>" +
                                                    "<tr>" +
                                                        "<th>Brand Type:</th>" +
                                                        "<td>&nbsp;&nbsp;" + dtServ.Rows[i]["BrandType"].ToString() + "</td>" +
                                                    "</tr>" +
                                                "</tbody></table>" +

                                                "</td>" +
                                                "<td class='right'></td>  " +
                                            "</tr>" +

                                            "<tr>" +
                                                "<td class='corner' id='bottomleft'></td>" +
                                                "<td class='bottom'><img width='30' height='29' alt='popup tail' src='image/bubble/bubble-tail2.png'/></td>" +
                                                "<td id='bottomright' class='corner'></td>" +
                                            "</tr>" +
                                        "</tbody></table></div>";
                //sServiceInnerHtml += "<div style='font-size:14px'>" + dtServ.Rows[i]["CategoryName"].ToString() + "</div>";
                //sServiceInnerHtml += "<div style='font-size:12px'>" + dtServ.Rows[i]["ServiceType"].ToString() + "</div>";
                sServiceInnerHtml += "<div style='width:100%;height:50px;text-align:center;vertical-align:middle;'><strong><table style='width:100%;'><tr><td class='priceFrom'>From <br/>" + dtServ.Rows[i]["PriceRangeFrom"].ToString() + "</td><td class='priceTo'>To<br/> " + dtServ.Rows[i]["PriceRangeTo"].ToString() + "</td></tr></table></strong></div>";
                sServiceInnerHtml += "</div>";
            }

            divMainItem.InnerHtml = sServiceInnerHtml;
        }