public static string LoadProductData(string strPageSize, string strPageIndex, string strProperty, string strColor, string strSize, string strOrderBy, string strProduct, string strPrice) { strProduct = strProduct.ToString().Replace(" ", "_"); string strTotalCount = ""; string strMinPrice = ""; string strMaxPrice = ""; if (strPrice != "") { string[] strvalue = strPrice.Split(';'); strMinPrice = strvalue[0]; strMaxPrice = strvalue[1]; } string strRate = "1"; DataTable objDataTable = new DataTable(); if (strProduct == Enums.Enum_SearchTableName.Featured_Products.ToString()) { tblFeaturedProduct objFeatureProduct = new tblFeaturedProduct(); objDataTable = objFeatureProduct.LoadAllProductByPaging(strPageSize, strPageIndex, strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); strTotalCount = objFeatureProduct.GetCountProductByPaging(strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); objFeatureProduct = null; } else if (strProduct == Enums.Enum_SearchTableName.Best_Seller.ToString()) { tblBestSeller objBestSeller = new tblBestSeller(); objDataTable = objBestSeller.LoadAllProductByPaging(strPageSize, strPageIndex, strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); strTotalCount = objBestSeller.GetCountProductByPaging(strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); objBestSeller = null; } else if (strProduct == Enums.Enum_SearchTableName.New_Products.ToString()) { tblNewArrival objNewArrival = new tblNewArrival(); objDataTable = objNewArrival.LoadAllProductByPaging(strPageSize, strPageIndex, strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); strTotalCount = objNewArrival.GetCountProductByPaging(strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); objNewArrival = null; } else if (strProduct == Enums.Enum_SearchTableName.Trending.ToString()) { tblTrending objTrending = new tblTrending(); objDataTable = objTrending.LoadAllProductByPaging(strPageSize, strPageIndex, strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); strTotalCount = objTrending.GetCountProductByPaging(strProperty, strColor, strSize, strOrderBy, strMinPrice, strMaxPrice, strRate); objTrending = null; } StringBuilder strdiv = new StringBuilder(); if (objDataTable.Rows.Count > 0) { PageBase objPage = new PageBase(); string strPageName = objPage.GetAlias("ProductDetail.aspx"); // int i = 0; foreach (DataRow row in objDataTable.Rows) { strdiv.Append(" <div class='col_1_of_3 span_1_of_3'>"); //if (strSubCategory != "") //{ strdiv.Append("<a href='" + strPageName + objPage.generateUrl(row[tblProduct.ColumnNames.AppProductName].ToString()) + "'>"); //} //else //{ // strdiv.Append("<a href='" + strPageName + objPage.generateUrl(strCategory) + "/" + objPage.generateUrl(row[tblProduct.ColumnNames.AppProductName].ToString()) + "'>"); //} strdiv.Append("<div class='inner_content clearfix'>"); strdiv.Append("<div class='product_image'>"); if (Convert.ToInt32(row["appoff"].ToString()) == 0) { strdiv.Append("<span class='discount' style='display:none'>" + row["appoff"].ToString() + "% <span>Off</span></span>"); } else { strdiv.Append("<span class='discount' style='display:block'>" + row["appoff"].ToString() + "% <span>Off</span></span>"); } strdiv.Append("<img src='" + GetServerURL() + "/admin/" + row[tblProductImage.ColumnNames.AppNormalImage].ToString() + "' alt='' />"); strdiv.Append("</div>"); //strdiv.Append(" <div class='sale-box'>"); //strdiv.Append(" <span class='on_sale title_shop'>New</span></div>"); //strdiv.Append("</div>"); strdiv.Append("<div class='price'>"); strdiv.Append("<p class='title'>"); strdiv.Append(row[tblProduct.ColumnNames.AppProductName].ToString()); strdiv.Append("</p>"); strdiv.Append("<div class='cart-left'>"); strdiv.Append("<div class='price1'>"); strdiv.Append(" <span class='actual'>"); strdiv.Append(HttpContext.Current.Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + Math.Round(Convert.ToDecimal(HttpContext.Current.Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(row[tblProductDetail.ColumnNames.AppPrice].ToString()), 0).ToString()); strdiv.Append("</span>"); if (Convert.ToInt32(row["appoff"].ToString()) == 0) { strdiv.Append("<span class='priceMiddle' style='display:none'>"); } else { strdiv.Append("<span class='priceMiddle' style='display:block'>"); } strdiv.Append("<strike><span>"); strdiv.Append(HttpContext.Current.Session[appFunctions.Session.CurrencyImage.ToString()].ToString() + Math.Round(Convert.ToDecimal(HttpContext.Current.Session[appFunctions.Session.CurrencyInRupee.ToString()].ToString()) * Convert.ToDecimal(row[tblProductDetail.ColumnNames.AppMRP].ToString()), 0).ToString()); strdiv.Append("</span></strike></span>"); strdiv.Append("</div>"); strdiv.Append("</div>"); strdiv.Append("<a href='javascript:void(0);' Class='cart-right' onclick='AddToCart(" + row[tblProductDetail.ColumnNames.AppProductDetailID].ToString() + "," + row[tblProduct.ColumnNames.AppProductID].ToString() + "," + row[tblProductColor.ColumnNames.AppProductColorID].ToString() + "," + row[tblProductDetail.ColumnNames.AppSizeID].ToString() + ")'>Add To Cart</a>"); strdiv.Append("<div class='clear'>"); strdiv.Append("</div>"); strdiv.Append("</div>"); strdiv.Append("</div>"); strdiv.Append("</a>"); strdiv.Append("</div>"); } } return(strdiv.ToString() + "|" + strTotalCount); }