//[Route("site/{key:guid}")] public async Task <ActionResult> Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } // return Content("show site: "+ key); var site = (Site)DocumentDBRepository <Site> .GetItem(d => d.Id == id); ViewBag.siteName = site.Name; ViewBag.Lat = site.geometry.coordinates[1]; ViewBag.Lng = site.geometry.coordinates[0]; ViewBag.Suburb = site.SiteSuburb; var prices = (SiteProduct)DocumentDBRepository <SiteProduct> .GetItems(d => d.SiteId == id).FirstOrDefault(); if (prices == null) { var p = new SiteProduct { SiteId = id, SiteName = site.Name, State = site.State, CreatedDate = DateTime.Now }; await DocumentDBRepository <SiteProduct> .CreateItemAsync(p); //create doco} return(View(p)); } //ViewData["Prices"]= prices; return(View(prices)); }
protected void FindPreviews() { PageSize = 5; PageNum = _pg; FirstRow = PageNum * PageSize - PageSize; int CurrentRow = 0; SiteProduct previewData = new SiteProduct(); DataSet dsfinder = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); dsfinder = previewData.Get_Site_Trials_Demos_List_Youtube(); _ds_nr = dsfinder.Tables[0].Rows.Count; LoadFinderPagination(_ds_nr); foreach (DataTable table in dsfinder.Tables) { foreach (DataRow row in table.Rows) { if ((FirstRow <= CurrentRow) && (CurrentRow < (PageNum * PageSize))) { sb.AppendLine("<div class=\"trialProduct\">"); if (Session[SiteConstants.UserValidLogin] != null && (bool)Session[SiteConstants.UserValidLogin]) { sb.AppendLine("<p><a href=\"getResourceVideo.aspx?pid=" + row["TitleId"].ToString() + "\" rel=\"width:800,height:620,ajax:true\" id=\"mb10\" class=\"mb\" title=\"See Video\">" + row["Title"] + "</a></p>"); } else { sb.AppendLine("<a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\">" + row["Title"] + "</a>"); } sb.AppendLine("<p>" + row["TitleText"] + "</p><img src=\"" + Global.globalSiteImagesPath + "/lineDotted.jpg\" alt=\"\" width=\"331\" height=\"1\"/></div>"); } if (CurrentRow > (PageNum * PageSize)) break; CurrentRow++; } } pagesContent.Text = sb.ToString(); }
public async Task <ActionResult> Create(string type, string key) { if (Helper.VerifyFuelType(type)) { var site = (DocDBSite)DocumentDBRepository <DocDBSite> .GetItem(x => x.id == key); if (site != null) { ViewBag.FuelType = type; var item = (SiteProduct)DocumentDBRepository <SiteProduct> .GetItem(x => x.SiteId == key); if (item != null) { item.FuelType = type.ToUpper(); return(View(item)); } else { var p = new SiteProduct { SiteId = key, SiteName = site.Name, FuelType = type.ToUpper(), CreatedDate = DateTime.Now }; await DocumentDBRepository <SiteProduct> .CreateItemAsync(p); //create doco} return(View(p)); } } } //return Content("create " +key); ViewBag.Message = "Error can't locate you request!"; return(RedirectToAction("Index")); //return View("Index"); }
protected void LoadTitSubConFreeTools() { SiteProduct classificationProducts = new SiteProduct(); DataSet dsclassificationProducts = new DataSet(); int cont = 0; dsclassificationProducts = classificationProducts.Get_Title_Content_Site_Free_Tools(); foreach (DataTable table in dsclassificationProducts.Tables) { foreach (DataRow row in table.Rows) { title[cont] = row["FreeTitle1"].ToString(); subTitle[cont] = row["FreeSubTitle1"].ToString(); content[cont] = row["FreeContent1"].ToString(); cont++; title[cont] = row["FreeTitle2"].ToString(); subTitle[cont] = row["FreeSubTitle2"].ToString(); content[cont] = row["FreeContent2"].ToString(); cont++; title[cont] = row["FreeTitle3"].ToString(); subTitle[cont] = row["FreeSubTitle3"].ToString(); content[cont] = row["FreeContent3"].ToString(); } } pagePrintTitle = title[1].ToString(); pagePrintSubTitle = subTitle[1].ToString(); pagePrintContent = content[1].ToString(); }
public static string ForGameTitle(this HtmlHelper helper, SiteProduct p) { if (!(p is IReferencable productWithGameReference)) { return(""); } var game = _contentLoader.Service.Get <GameProduct>(productWithGameReference.GetGameReference()); return(game.Name + ":"); }
public async Task <ActionResult> Create(SiteProduct p) //Create([Bind(Include = "Id,SiteId,FuelType,Cost,SubmittedBy,IsPublished")] Price p) { if (ModelState.IsValid) { var site = (DocDBSite)DocumentDBRepository <DocDBSite> .GetItem(x => x.id == p.SiteId); if (site != null) { DocumentDBRepository <DocDBSite> .ExecuteStoredProcedureUpdatePriceAsync(p.SiteId, p.FuelType, p.FuelValue, User.Identity.GetUserId()); return(RedirectToAction("Details", "Site", new { id = p.SiteId })); } return(RedirectToAction("Index", "Site")); } return(View(p)); }
protected void FindTrials() { PageSize = 5; PageNum = _pg; FirstRow = PageNum * PageSize - PageSize; int CurrentRow = 0; SiteProduct trialsData = new SiteProduct(); DataSet dsfinder = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); dsfinder = trialsData.Get_Site_Trials_Demos_List(52); if (dsfinder != null) { _ds_nr = dsfinder.Tables[0].Rows.Count; } else { _ds_nr = 0; } if (_ds_nr > 0) { LoadFinderPagination(_ds_nr); foreach (DataTable table in dsfinder.Tables) { foreach (DataRow row in table.Rows) { if ((FirstRow <= CurrentRow) && (CurrentRow < (PageNum * PageSize))) { sb.AppendLine("<div class=\"trialProduct\"><p>"); if (Session[SiteConstants.UserValidLogin] != null && (bool)Session[SiteConstants.UserValidLogin]) { sb.AppendLine("<a href=\"" + "#" + "\" onClick=\"downloadTrial(" + row["TitleID"] + "); return false;\">" + row["Title"] + "</a></p>"); } else { sb.AppendLine("<a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\">" + row["Title"] + "</a>"); } sb.AppendLine("<p>" + row["TitleText"] + "</p><img src=\"" + Global.globalSiteImagesPath + "/lineDotted.jpg\" alt=\"\" width=\"721\" height=\"1\"/></div>"); } if (CurrentRow > (PageNum * PageSize)) break; CurrentRow++; } } pagesContent.Text = sb.ToString(); } }
protected void Video() { SiteProduct previewData = new SiteProduct(); DataSet results = new DataSet(); StringBuilder sb = new StringBuilder(); results = previewData.Get_Site_Trials_Demos(Convert.ToInt32(ProductId), 53); foreach (DataTable table in results.Tables) { foreach (DataRow row in table.Rows) { //videoSpace.Text = row["TitleResourceLoc"].ToString(); sb.AppendLine("<div class=\"quote\">"); sb.AppendLine("<div class=\"quoteTop\">"); sb.AppendLine("<div class=\"popTitle\">Demo</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"quoteBody2\">"); sb.AppendLine(row["TitleResourceLoc"].ToString()); TitleResourceId = row["TitleResourceId"].ToString(); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"quoteTButt\"/></div>"); sb.AppendLine("</div>"); PlaceHolder_Video.Controls.Add(new LiteralControl(sb.ToString())); } if (table.Rows.Count == 0) { sb.AppendLine("<div class=\"quote\">"); sb.AppendLine("<div class=\"quoteTop\">"); sb.AppendLine("<div class=\"popTitle\">Video</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"quoteBody\"><br><br>"); sb.AppendLine("No video preview for this product"); sb.AppendLine("<br><br></div>"); sb.AppendLine("<div class=\"quoteTButt\"/></div>"); sb.AppendLine("</div>"); PlaceHolder_Video.Controls.Add(new LiteralControl(sb.ToString())); } else { addEventCapture(); } } sb = null; previewData = null; results = null; }
//--------------- protected void Page_Load(object sender, EventArgs e) { int contDiv = 0; SiteProduct pro = new SiteProduct(); intSite = Convert.ToInt32(HttpContext.Current.Session["SiteId"].ToString()); intCont = Convert.ToInt32(HttpContext.Current.Session["ContentId"].ToString()); DataSet data = new DataSet(); System.Text.StringBuilder sbproduct = new System.Text.StringBuilder(); data = pro.Get_SideBestSellers(intSite, intCont,intSubjId); foreach (DataTable table in data.Tables) { foreach (DataRow row in table.Rows) { sbproduct.AppendLine("<li><a href=\"product.aspx?p="+row["TitleID"]+"\">"+row["Title"]+"</a></li>"); contDiv++; } } if (contDiv != 0) { Product2.Controls.Add(new LiteralControl(sbproduct.ToString())); div_Wrapper.Visible = true; } }
protected void LoadRelated() { SiteProduct classificationProducts = new SiteProduct(); DataSet dsclassificationProducts = new DataSet(); StringBuilder sb = new StringBuilder(); int intProdId = 0; sb.AppendLine("<div class=\"contHead\">"); sb.AppendLine("<h3>Related Products</h3>"); //pageName = row["ClassDescription"].ToString(); //sb.AppendLine(row["ClassContent"].ToString()); sb.AppendLine("</div>"); try { intProdId = Convert.ToInt32(productId); } catch (Exception ex) { intProdId = 0; } dsclassificationProducts = classificationProducts.Get_Title_All_RelatedProducts(intProdId); if (dsclassificationProducts != null) { foreach (DataTable table in dsclassificationProducts.Tables) { foreach (DataRow row in table.Rows) { if (row["New_Flag"].ToString() == "1") { sb.AppendLine("<div class=\"prodContNew\">"); } else { sb.AppendLine("<div class=\"prodCont\">"); } sb.AppendLine("<div class=\"prodImg\">"); sb.AppendLine("<div id=\"boxContImage\" style=\"width:115px; height:115px;\">"); sb.AppendLine("<a href=\"product.aspx?p=" + row["titleid"].ToString() + "\"><img id=\"images\" style=\"width:102px; height:127px;\" title=\"" + row["pubname"].ToString() +" : " +row["title"].ToString() + "\" src=\"" + strFolder + "tn_" + row["ImageTN"] + "\"></a>");//onload=\"getDim(document.getElementById('boxContImage'),this)\" sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodDesc\">"); sb.AppendLine("<h2><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">" + row["title"].ToString() + "</a></h2>"); sb.AppendLine("<p><em>by: </em><a href=\"result.aspx?findopt5=" + row["PubId"].ToString() + "&am=1&asm=" + 3 + "\">" + row["pubname"].ToString() + "</a></p>"); sb.AppendLine("<h3> $" + String.Format("{0:#,0.00}", row["Er_price"]) + "</h3>"); if (Convert.ToDouble(row["youShave"].ToString()) > 0) { sb.AppendLine("<h4>Your DISCOUNTED price</h4>"); sb.AppendLine("<h5>You Save: $" + String.Format("{0:#,0.00}", row["youShave"]) + "</h5>"); } sb.AppendLine("<a href=\"#\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\">" + Cart.CreateAddToCartLink("<img src=\"" + Global.globalSiteImagesPath + "/addToCart.jpg\" width=\"109\" height=\"26\" />", row["titleid"].ToString(), row["defaultsku"].ToString(), 1, 0) + " </a>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodNumber\">"); sb.AppendLine("<div class=\"prodNumCont\">"); if ((row["Plat_Win_Flag"].ToString() == "1") && (row["Plat_Mac_Flag"].ToString() == "1")) { sb.AppendLine("<p>Mac / Windows</p>"); } else { sb.AppendLine("<p>" + (row["Plat_Win_Flag"].ToString() == "1" ? "Windows" : "") + "" + (row["Plat_Mac_Flag"].ToString() == "1" ? "Mac" : "") + "</p>"); } sb.AppendLine("<div class=\"numBG\">Grades<br /><span>" + row["grades"].ToString() + "</span></div>"); sb.AppendLine("<p>Item #: " + row["defaultSKU"].ToString() + "</p>"); sb.AppendLine("</div>"); //--Login Validate if ((bool)Session[SiteConstants.UserValidLogin]) { sb.AppendLine(" <a href=\"addWish.aspx?p=" + row["TitleId"].ToString()+"&sk="+row["defaultSKU"].ToString() +"\" rel=\"width:560,height:126,ajax:true\" id=\"mb10\" class=\"mb\" title=\"Add Product\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } else { sb.AppendLine("<a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } sb.AppendLine("<a href=\"requestaquote.aspx?title=" + row["Title"].ToString() + "\"><img src=\"" + Global.globalSiteImagesPath + "/quote.jpg\" border=\"0\"></a>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodMore\"><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">+ learn more</a></div>"); sb.AppendLine("</div>"); // cont++; } } } PlaceHolder_Clasification.Controls.Add(new LiteralControl(sb.ToString())); sb = null; classificationProducts = null; dsclassificationProducts = null; }
private void Get_Torch_Skus() { SiteProduct siteproduct = new SiteProduct(); DataSet dsTorchSku = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); dsTorchSku = siteproduct.Get_TorchPrices(); List<TorchPricesSku> ListOfSkus = new List<TorchPricesSku>(); foreach (DataTable table in dsTorchSku.Tables) { TorchPricesSku Sku; foreach (DataRow row in table.Rows) { Sku = new TorchPricesSku(row["subjectid"].ToString(), row["gradeid"].ToString(), row["SKU"].ToString(), row["price"].ToString()); ListOfSkus.Add(Sku); } } _ListOfSkus.AddRange(ListOfSkus); string a = ""; }
protected void LoadWhatNew() { SiteProduct classificationProducts = new SiteProduct(); DataSet dsclassificationProducts = new DataSet(); SiteWhatsNew whatnew = new SiteWhatsNew(); DataSet dswhatnew = new DataSet(); StringBuilder sb = new StringBuilder(); Main_MasterPage main = (Main_MasterPage)Page.Master; main._site_breadLink = "<li><a href=# onClick=\"return false;\"><strong>" + "Whats New" + "</strong></a></li>"; dsclassificationProducts = classificationProducts.Get_Title_Content_Site_Classification(Convert.ToInt32(classId)); foreach (DataTable table in dsclassificationProducts.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"contHead\">"); sb.AppendLine("<h3>" + row["ClassDescription"].ToString() + "</h3>"); sb.AppendLine(row["ClassContent"].ToString()); sb.AppendLine("</div>"); } } dswhatnew = whatnew.Get_All_Whats_New(); foreach (DataTable table in dswhatnew.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"prodCont\">"); sb.AppendLine("<div class=\"prodImg\">"); sb.AppendLine("<div id=\"boxContImage\" style=\"width:115px; height:115px;\">"); sb.AppendLine("<a href=\"product.aspx?p=" + row["titleid"].ToString() + "\"><img id=\"images\" style=\"width: 102px;height:127px;\" title=\"" + row["PubName"].ToString() +" : " +row["title"].ToString() + "\" src=\"" + strFolder + "tn_" + row["ImageTn"] + "\"></a>"); //onload=\"getDim(document.getElementById('boxContImage'),this)\" sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodDesc1\">"); sb.AppendLine("<h2><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">" + row["title"].ToString() + "</a></h2>"); sb.AppendLine(row["titletext"].ToString()); sb.AppendLine("<p><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">+ more information</a></p>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodNumber1\">"); sb.AppendLine("<a href=\"#\" id=\"A2\" class=\"mb\" title=\"\" rel=\"type:element\">" + Cart.CreateAddToCartLink("<img src=\"" + Global.globalSiteImagesPath + "/addToCart.jpg\" width=\"109\" height=\"26\" />", row["titleid"].ToString(), row["defaultsku"].ToString(), 1, 0) + " </a>"); //--Login Validate if ((bool)Session[SiteConstants.UserValidLogin]) { sb.AppendLine("<a href=\"addWish.aspx?p=" + row["TitleId"].ToString() + "&sk=" + row["defaultsku"] + "\" rel=\"width:580,height:131,ajax:true\" id=\"mb10\" class=\"mb\" title=\"Add Product\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } else { sb.AppendLine("<a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } sb.AppendLine("<a href=\"requestaquote.aspx?title=" + row["Title"].ToString() + "\"><img src=\"" + Global.globalSiteImagesPath + "/quote.jpg\" border=\"0\"></a>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); } } PlaceHolder_WhatsNew.Controls.Add(new LiteralControl(sb.ToString())); sb = null; classificationProducts = null; dsclassificationProducts = null; whatnew = null; dswhatnew = null; }
private void Get_Title_Review() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_Review(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { ProRev1.Visible = false; opt_pro.Visible = false; } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<p>" + row["TitleReview"].ToString() + "</p>"); } } PlaceHolder_Review.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private void Get_Title_SysReq_OpeSys() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_SysReq_OpeSys(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { SysReq1.Visible = false; SysReq2.Visible = false; opt_sys.Visible = false; } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<p>" + row["comptypename"].ToString() + " " + row["sysreqname"].ToString() + "</p>"); } } //PlaceHolder_SysReqCPU.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; dsSitePrice = siteproduct.Get_Title_SysReq_MemCPU(TitleId); foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<p>CPU PC:" + row["PCCpu"].ToString() + "</p>"); sb.AppendLine("<p>Memory PC:" + row["PCMemory"].ToString() + "</p>"); sb.AppendLine("<p>CPU Mac:" + row["MacCpu"].ToString() + "</p>"); sb.AppendLine("<p>Memory Mac:" + row["MacMemory"].ToString() + "</p>"); } } PlaceHolder_SysReqCPU.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
protected string LoadWishList(Guid id) { int TitleId = 0; SiteWish wishList = new SiteWish(); DataSet dswishList = new DataSet(); StringBuilder sb = new StringBuilder(); Boolean entro = false; //dswishList = wishList.Get_All_Wish_By_Session(); dswishList = wishList.Get_All_Wish_By_GUID(id); if (dswishList == null) return ""; foreach (DataTable table in dswishList.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"prodwish\">"); sb.AppendLine("<div class=\"prodImg\">"); sb.AppendLine("<div id=\"boxContImage\" style=\"width:115px; height:115px;\">"); sb.AppendLine("<a href=\"product.aspx?p=" + row["titleid"].ToString() + "\"><img id=\"images\" style=\"width: 102px;height:127px;\" title=\"" + row["pubname"].ToString() + " : " + row["title"].ToString() + "\" src=\"" + strFolder + "tn_" + row["imageTN"].ToString() + "\"></a>"); //onload=\"getDim(document.getElementById('boxContImage'),this)\" sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodSrcDesc\">"); sb.AppendLine("<h2><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "&s=" + row["SKU"].ToString() + "\">" + row["title"].ToString() + "</a></h2>"); sb.AppendLine("<p><em>by: </em> <a href=\"result.aspx?findopt5=" + row["PubId"].ToString() + "&am=1&asm=" + 3 + "\">" + row["pubname"].ToString() + "</a></p>"); sb.AppendLine("<h3> $" + Convert.ToDouble(row["price"].ToString()) + "</h3>"); if (Convert.ToDouble(row["youShave"].ToString()) > 0) { sb.AppendLine("<h4>Your DISCOUNTED price</h4>"); sb.AppendLine("<h5>You Save: $" + Convert.ToDouble(row["youShave"].ToString()) + "</h5>"); } sb.AppendLine("Date Added: " + row["CreateDate"].ToString() + "<br />"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodNumber\">"); sb.AppendLine("<div class=\"prodNumCont\">"); if ((row["Plat_Win_Flag"].ToString() == "1") && (row["Plat_Mac_Flag"].ToString() == "2")) { sb.AppendLine("<p>Mac / Windows</p>"); } else { sb.AppendLine("<p>" + (row["Plat_Win_Flag"].ToString() == "1" ? "Windows" : "") + "" + (row["Plat_Mac_Flag"].ToString() == "2" ? "Mac" : "") + "</p>"); } sb.AppendLine("<div class=\"numBG\">Grades<br /><span>" + row["grades"].ToString() + "</span></div>"); sb.AppendLine("<p>Item #: " + row["SKU"].ToString() + "</p>"); sb.AppendLine("</div>"); //sb.AppendLine("<a href=\"#\" id=\"A2\" class=\"mb\" title=\"\" rel=\"type:element\">" + Cart.CreateAddToCartLink("<img src=\"" + Global.globalSiteImagesPath + "/btnMovetoCart.jpg\"/>", row["titleId"].ToString(), row["SKU"].ToString(), 1, Convert.ToInt32(row["WishListId"].ToString())) + "</a>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); TitleId = Convert.ToInt32(row["TitleId"]); } SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); dsSitePrice = siteproduct.Get_Title_RelatedProducts(TitleId); foreach (DataTable tableProducts in dsSitePrice.Tables) { foreach (DataRow row in tableProducts.Rows) { if (entro == false){ entro = true; sb.AppendLine("<div id=\"resultControls\">"); sb.AppendLine("<h2>Similar Products</h2>"); sb.AppendLine("<div id=\"SlideItMoo_outer\">"); sb.AppendLine("<div id=\"SlideItMoo_inner\">"); sb.AppendLine("<div id=\"SlideItMoo_items\">"); } sb.AppendLine("<div class=\"SlideItMoo_element\"><a href=\"product.aspx?p=" + row["titleid"].ToString() + "\" style=\"background-color:#FFF;\"><img src=\"" + strFolder + "tn_" + row["imageTN"].ToString() + "\" title=\"" + row["PubName"].ToString() + " : " + row["title"].ToString() + "\" /></a><p>" + row["title"].ToString() + "</p></div>"); } } if (entro == true){ sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); } } return sb.ToString(); }
private void Get_Title_Resources() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //---exec [Get_Title_Resources] 1640 dsSitePrice = siteproduct.Get_Title_Resources(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { ProRes1.Visible = false; ProRes2.Visible = false; opt_res.Visible = false; } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<p>"); if (row["UrlFlag"].ToString() == "1") { sb.AppendLine("<a href=\"" + row["titleresourceLoc"].ToString() + "\"target=\"blank\">" + row["titleresourcetypeName"].ToString() + "</a>"); } else { sb.AppendLine("<a href=\"http://external.edresources.com/ProductDocs/" + row["titleresourceLoc"].ToString() + "\"target=\"blank\"> " + row["titleresourcetypeName"].ToString() + "</a>"); } sb.AppendLine("</p>"); } } PlaceHolder_ProRes.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private void Get_Title_Funding() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_Funding(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { Funding1.Visible = false; Funding2.Visible = false; opt_fun.Visible = false; } string strcategory = ""; string strNcategory = ""; foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { strcategory = row["Category"].ToString(); if (strcategory != strNcategory) { sb.AppendLine("<p><b><i> "+ row["Category"].ToString() + "</i></b></p>");} sb.AppendLine("<p style=\"margin-left:10px;\"><i>" + row["SubCategory"].ToString() + "</i><br/><br/>" + row["SubCategoryDesc"].ToString() + "</p>"); strNcategory = strcategory; //sb.AppendLine("<p><b><i>" + row["SubCategory"].ToString() + "</i></b><br/><br/>" + row["SubCategoryDesc"].ToString() + "</p>"); } } PlaceHolder_funding.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private void Get_Title_Images() { string MasterImagePath; string BigImagePath; SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_Images(TitleId); int contrec = 1; MasterImagePath = strFolder + _Imagetn; BigImagePath = strFolderBig + _Imagetn; sb.AppendLine("<div id=\"lock" + contrec.ToString() + "\" style=\"width: 56px; height: 56px; float: left; padding: 0px; "); sb.AppendLine("border: solid 2px #333; margin: 4px; float: left; overflow: hidden;\" onclick=\"selectlock(this.id);\">"); //sb.AppendLine("<a href=\"#\" style=\"text-decoration: none;\">"); sb.AppendLine("<a href='#' onclick=\"changeMasterImage('" + MasterImagePath + "','" + BigImagePath + "');\" style=\"text-decoration: none;\">"); sb.AppendLine(" <img id=\"images1\" style=\"width: 56px; height: 56px;\" src=\"" + strFolderTb + "tn_" + _Imagetn + " \"/>"); //onload=\"getDim(document.getElementById('lock" + contrec.ToString() + "'),this)\" sb.AppendLine("</a>"); sb.AppendLine("</div>"); if (dsSitePrice != null){ foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { contrec++; sb.AppendLine("<div id=\"lock" + contrec.ToString() + "\" style=\"width: 56px; height: 56px;"); sb.AppendLine("border: solid 2px #333; margin: 4px; float: left; overflow: hidden;\" onclick=\"selectlock(this.id);\">"); MasterImagePath = strFolderAdd + row["titleresource"].ToString(); BigImagePath = strFolderAdd + row["titleresource"].ToString(); sb.AppendLine("<a href='#' onclick=\"changeMasterImage('" + MasterImagePath + "','" + BigImagePath + "');\" style=\"text-decoration: none;\">"); sb.AppendLine("<img id=\"images\" style=\"width: 56px; height: 56px;\" src=\"" + strFolderAdd + "" + row["titleresource"].ToString() + "\" >"); //onload=\"getDim(document.getElementById('boxContImage'),this)\"/ sb.AppendLine("</a>"); sb.AppendLine("</div>"); } } } PlaceHolder_ProImages.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private bool Get_Title_RelatedProducts(int TitleId) { bool has_related = false; SiteProduct siteproduct = new SiteProduct(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); DataSet dsSitePrice = siteproduct.Get_Title_RelatedProducts(TitleId); if (dsSitePrice != null && dsSitePrice.Tables != null) { foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { if (!has_related) has_related = true; sb.AppendLine("<div class=\"SlideItMoo_element\"><a href=\"product.aspx?p=" + row["titleid"].ToString() + "\" style=\"background-color:#FFF;\"><img src=\"" + strFolder + row["imagetn"].ToString() + "\" title=\"" + row["PubName"].ToString() + " : " + row["title"].ToString() + "\" height=\"100px\"/></a><p>" + row["title"].ToString() + "</p></div>"); } } } PlaceHolser_Slide.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; return has_related; }
protected void LoadPubHead() { SiteProduct publisherList = new SiteProduct(); DataSet dspublisherList = new DataSet(); StringBuilder sb = new StringBuilder(); dspublisherList = publisherList.Get_Title_Content_Publisher(Convert.ToInt32(pubId)); if (dspublisherList != null) { foreach (DataTable table in dspublisherList.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"contHead\">"); sb.AppendLine("<h3>" + row["Description"].ToString() + "</h3>"); sb.AppendLine("<h4>" + row["PubName"].ToString() + "</h4>"); sb.AppendLine(row["Contenido"].ToString()); sb.AppendLine("</div>"); PlaceHolder_PublisherList_Head.Controls.Add(new LiteralControl(sb.ToString())); } } } }
private void Get_SitePrice_by_Title() { Addins addins = new Addins(); SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_LicenseOptions(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { LicOpt.Visible = false; opt_lic.Visible = false; } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"formAccordion cellColorGray\">"); sb.AppendLine("<div class=\"formSKU\" alt=\"" + row["SKU"].ToString() + "\">" + CutSKU(row["SKU"].ToString()) + "</div>"); sb.AppendLine("<div class=\"formDesc1\">" + row["SKUDesc"].ToString() + "</div>"); if ((row["plat_win_flag"].ToString() == "1") && (row["plat_mac_flag"].ToString() == "1")) { sb.AppendLine("<div class=\"formQty1\">Mac/Win</div>"); } else { sb.AppendLine("<div class=\"formQty1\">" + (row["plat_win_flag"].ToString() == "1" ? "Win" : "") + "" + (row["plat_mac_flag"].ToString() == "1" ? "Mac" : "") + "</div>"); } sb.AppendLine("<div class=\"formVersion\" title=\"" + row["Version"].ToString() + "\">" + CutSKU2(row["Version"].ToString()) + "</div>"); sb.AppendLine("<div class=\"formUnit\">$" + row["ER_Price"].ToString() + "</div>"); sb.AppendLine("<div class=\"formTotal\"><a href=\"product.aspx?p=" + _TitleId + "&s=" + row["SKU"].ToString() + "\"><img src=\"images/selectBtn.jpg\"/></a></div>"); sb.AppendLine("</div>"); AdditionalLic++; } } PlaceHolder_LicOptions.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
protected void ContinueButton_Clicked(object sender, EventArgs e) { string cont = "";// Request["emailTo"].ToString(); sendEmail send = new sendEmail(); bool success = true; int orderIdEmail = 0; // Submit Order CartDB db = new CartDB(); if (CurrentCart.Completed == false) { int order_id, payment_id; success = db.Order_Post_Cart(CurrentCart, CartUsers.GetLoginID(), SalesRepFlagCheckbox.Checked ? 1 : 0, out order_id, out payment_id,Convert.ToString(SumaryComents.Value)); success = db.CartUpdatePaymentOrderIDs(CurrentCart.PaymentId, order_id, payment_id); if (Session["TorchInCart"] != null && bool.Parse(Session["TorchInCart"].ToString()) == true) { ArrayList listSkusDesc = new ArrayList(); ArrayList listSkus = new ArrayList(); int orderId = Convert.ToInt32(Session["orderIdForTorch"]); SiteProduct product = new SiteProduct(); DataSet torchData = product.Get_TorchDescription(this.CurrentCart.CartId); foreach (DataTable table in torchData.Tables) { foreach (DataRow Confdetail in table.Rows) { listSkus.Add(Confdetail["sku"].ToString()); listSkusDesc.Add(new LisTorchDescription(Confdetail["sku"].ToString(), Confdetail["description"].ToString())); } } HashSet hs = new HashSet(); hs.AddAll(listSkus); listSkus.Clear(); listSkus.AddRange(hs); foreach(string sku in listSkus) { string finalDescription = ""; foreach (LisTorchDescription sku2 in listSkusDesc) { if(sku.Equals(sku2.SKU)) { finalDescription += "|" + sku2.Description + "|"; } } product.Add_Torch_Description(orderId, finalDescription, sku); } Session["TorchInCart"] = null; Session["orderIdForTorch"] = null; } if (CartUsers.IsUserLoggedIn(Session) && CurrentCart.BillingLocation != null) { int login_id = CartUsers.GetLoginID(); db.LoginUpdBillingAddress(login_id, CurrentCart.BillingLocation.BusinessName, CurrentCart.BillingLocation.Address1, CurrentCart.BillingLocation.Address2, CurrentCart.BillingLocation.City, CurrentCart.BillingLocation.StateCode, CurrentCart.BillingLocation.PostalCode, CurrentCart.BillingLocation.CountryCode, CurrentCart.BillingLocation.Phone); } } CartDB de = new CartDB(); cont = cont.Replace("\n\r", ""); //before making any substitution, check that there are no new lines in the code. Windows cont = cont.Replace("\n", ""); // Unix: note that this code will not change anyting in windows, due to the first line cont = cont.Replace("<img src=\"images/buttonEdit.jpg\" alt=\"Edit\" />", "");// Why will I want and edit button in the mail ?"<img src=\"http://www.edresources.com/images/buttonEdit.jpg\" alt=\"Edit\" />"); cont = cont.Replace("type=\"checkbox\"", "type=\"hidden\""); cont = cont.Replace("textarea","div style='display:none;'"); cont = cont.Replace("TEXTAREA", "div style='display:none;'"); cont = cont.Replace("Comments", ""); cont = cont.Replace("/ Special Instructions:", ""); cont = System.Text.RegularExpressions.Regex.Replace(cont, "<img class=\"first-child", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); cont = System.Text.RegularExpressions.Regex.Replace(cont, "last-child\" alt=\"Edit\">", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); cont = System.Text.RegularExpressions.Regex.Replace(cont,"last-child\" alt=Edit src=\"images/buttonEdit.jpg\">","",System.Text.RegularExpressions.RegexOptions.IgnoreCase); cont = System.Text.RegularExpressions.Regex.Replace(cont,"last-child\" alt=Edit src=\"images2/buttonEdit.jpg\">","",System.Text.RegularExpressions.RegexOptions.IgnoreCase); cont = System.Text.RegularExpressions.Regex.Replace(cont,"last-child\" alt=\"Place Order\" src=\"images/buttonPlaceOrder.jpg\">","<br>", System.Text.RegularExpressions.RegexOptions.IgnoreCase); cont = cont.Replace("Special Instructions:", "<b>Special Instructions:</b>"); if (!SalesRepFlagCheckbox.Checked) { cont = cont.Replace("Yes, a sales rep helped me with this order", " "); } if (success) { DataSet data2 = new DataSet(); data2 = de.Get_OrderId_By_Email(CartUsers.GetLoginID()); foreach (DataTable table2 in data2.Tables) { foreach (DataRow row2 in table2.Rows) { orderIdEmail = Convert.ToInt32(row2["OrderID"]); } } Session["orderpoid"] = orderIdEmail; if (CurrentCart.Payment.PaymentType == (int)PaymentType.CC) { send.toEmail(cont, CurrentCart.BillingLocation.Email, orderIdEmail); CurrentCart.MoveNextStep(); } else { send.toEmail(cont, CurrentCart.BillingLocation.Email, orderIdEmail); CurrentCart.MoveToStep((int)Constants.CheckoutStep.PurchaseOrder); } Response.Redirect(Constants.Pages.CHECKOUT); } }
protected void LoadPubContent() { //-- PageSize = 5; PageNum = _pg; FirstRow = PageNum * PageSize - PageSize; int CurrentRow = 0; //-- SiteProduct publisherList = new SiteProduct(); DataSet dspublisherList = new DataSet(); StringBuilder sb = new StringBuilder(); string pubName = ""; dspublisherList = publisherList.Get_All_Publisher_By_Id(Convert.ToInt32(pubId)); _ds_nr = dspublisherList.Tables[0].Rows.Count; LoadFinderPagination(_ds_nr, pubId); foreach (DataTable table in dspublisherList.Tables) { foreach (DataRow row in table.Rows) { if ((FirstRow <= CurrentRow) && (CurrentRow < (PageNum * PageSize))) { if (row["New_Flag"].ToString() == "1") { sb.AppendLine("<div class=\"prodContNew\">"); } else { sb.AppendLine("<div class=\"prodCont\">"); } sb.AppendLine("<div class=\"prodImg\">"); sb.AppendLine("<div id=\"boxContImage\" style=\"width:102px; height:127px;\">"); sb.AppendLine("<a href=\"product.aspx?p=" + row["titleid"].ToString() + "\"><img id=\"images\" style=\"width: 102px;height:127px;\" src=\"" + strFolder + "tn_" + row["imageTN"].ToString() + "\" ></a>"); //onload=\"getDim(document.getElementById('boxContImage'),this)\" sb.AppendLine("</div>"); sb.AppendLine("</div>"); pubName = row["pubname"].ToString(); sb.AppendLine("<div class=\"prodDesc\">"); sb.AppendLine("<h2><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">" + row["title"].ToString() + "</a></h2>"); sb.AppendLine("<p><em>by: </em><a href=\"PublisherList.aspx?idP=" + row["PubId"].ToString() + "\">" + row["pubname"].ToString() + "</a></p>"); sb.AppendLine("<h3> $" + Convert.ToDouble(row["er_price"].ToString()) + "</h3>"); if (Convert.ToDouble(row["youShave"].ToString()) > 0) { sb.AppendLine("<h4>Your DISCOUNTED price</h4>"); sb.AppendLine("<h5>You Save: $" + Convert.ToDouble(row["youShave"].ToString()) + "</h5>"); } sb.AppendLine("<a href=\"#\" id=\"A2\" class=\"mb\" title=\"\" rel=\"type:element\">" + Cart.CreateAddToCartLink("<img src=\"" + Global.globalSiteImagesPath + "/addToCart.jpg\" width=\"109\" height=\"26\" />", row["titleid"].ToString(), row["defaultsku"].ToString(), 1, 0) + " </a>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodNumber\">"); sb.AppendLine("<div class=\"prodNumCont\">"); if ((row["Plat_Win_Flag"].ToString() == "1") && (row["Plat_Mac_Flag"].ToString() == "2")) { sb.AppendLine("<p>Mac / Windows</p>"); } else { sb.AppendLine("<p>" + (row["Plat_Win_Flag"].ToString() == "1" ? "Windows" : "") + "" + (row["Plat_Mac_Flag"].ToString() == "2" ? "Mac" : "") + "</p>"); } sb.AppendLine("<div class=\"numBG\">Grades<br /><span>" + row["grades"].ToString() + "</span></div>"); sb.AppendLine("<p>Item #: " + row["defaultSKU"].ToString() + "</p>"); sb.AppendLine("</div>"); //--Login Validate if ((bool)Session[SiteConstants.UserValidLogin]) { sb.AppendLine(" <a href=\"addWish.aspx?p=" + row["TitleId"].ToString() + "\" rel=\"width:800,height:300,ajax:true\" id=\"mb10\" class=\"mb\" title=\"Add Product\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } else { sb.AppendLine("<a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\"><img src=\"" + Global.globalSiteImagesPath + "/addToWish.jpg\" border=\"0\"></a>"); } sb.AppendLine("<a href=\"requestaquote.aspx?title=" + row["Title"].ToString() + "\"><img src=\"" + Global.globalSiteImagesPath + "/quote.jpg\" border=\"0\"></a>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodMore\"><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "\">+ learn more</a></div>"); sb.AppendLine("</div>"); } if (CurrentRow > (PageNum * PageSize)) break; CurrentRow++; } } PlaceHolder_PublisherList_Content.Controls.Add(new LiteralControl(sb.ToString())); Main_MasterPage main = (Main_MasterPage)Page.Master; main.pageTitleBar = "Publisher List - " + pubName + " - " + main.pageTitleBar; sb = null; publisherList = null; dspublisherList = null; }
private int titleResourceTypeIdTrials = 52; // ID Generic Default correspondiente al Resource Type Id For Trials. #endregion Fields #region Methods protected void LoadInfoDemos() { SiteProduct classificationProducts = new SiteProduct(); DataSet dsclassificationProducts = new DataSet(); StringBuilder sb = new StringBuilder(); int cont = 1; sb.AppendLine("<div class=\"mainAccount\"><h1>" + title[1].ToString() + "</h1></div>"); sb.AppendLine("<div class=\"mainAccount1\">"); sb.AppendLine("<h2>" + subTitle[1].ToString() + "</h2>"); sb.AppendLine("<p>" + content[1].ToString() + "</p>"); sb.AppendLine("<div class=\"FreeToolsTab\"><img src=\"" + Global.globalSiteImagesPath + "/top5Prev.jpg\" /></div>"); sb.AppendLine("<div class=\"FreeTools\">"); sb.AppendLine("<div class=\"FreeToolsTop\">"); sb.AppendLine("<div class=\"FreeToolsButt\">"); sb.AppendLine("<ul>"); SiteProduct freeTools = new SiteProduct(); DataSet dsfreeTools = new DataSet(); dsfreeTools = freeTools.Get_All_Freetools_By_Id(Convert.ToInt32(GeneDefaIdDemos), Convert.ToInt32(titleResourceTypeIdDemos)); foreach (DataTable table in dsfreeTools.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<li>"); sb.AppendLine("<img src=\"" + Global.globalSiteImagesPath + "/list0" + cont + ".jpg\" width=\"19\" height=\"18\" />"); //sb.AppendLine("<p><a href=\"#\">" + row["title"].ToString() + "</a></p>"); if (Session[SiteConstants.UserValidLogin] != null && (bool)Session[SiteConstants.UserValidLogin]) { //sb.AppendLine("<p><a href=\"#hiddenVideo\" id=\"A1\" class=\"mb\" title=\"Demo\" alt=\"View Demo\" rel=\"type:element\" onClick=\"changeVideo(" + row["TitleId"] + ")\">" + row["Title"] + "</a></p>"); sb.AppendLine("<a href=\"getResourceVideo.aspx?pid=" + row["TitleId"].ToString() + "\" rel=\"width:600,height:436,ajax:true\" id=\"A2\" class=\"mb\" title=\"See Video\">" + row["Title"] + "</a>"); } else { sb.AppendLine("<p><a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" title=\"\" rel=\"type:element\">" + row["Title"] + "</a></p>"); } strTitleText = row["titleText"].ToString(); string strTitleTextB = strTitleText.Substring(0, 55); sb.AppendLine("<p>" + strTitleTextB + "...</p>"); sb.AppendLine("</li>"); cont++; } } sb.AppendLine("</ul>"); sb.AppendLine("<div class=\"toolMore\"><a href=\"preview.aspx\">+ view more</a></div>"); sb.AppendLine("<div class=\"clear\"></div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); PlaceHolder_Trials.Controls.Add(new LiteralControl(sb.ToString())); sb = null; classificationProducts = null; dsclassificationProducts = null; freeTools = null; dsfreeTools = null; }
private void Get_Title_RelatedProducts() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- dsSitePrice = siteproduct.Get_Title_RelatedProducts(TitleId); _numRelatedProduct = dsSitePrice.Tables[0].Rows.Count; if (_numRelatedProduct == 0) { RelPro.Visible = false; opt_sim.Visible = false; } else { if (_numRelatedProduct > 1 && _numRelatedProduct < 5) { _numRelatedSlide = _numRelatedProduct - 1; } else { if (_numRelatedProduct == 1) _numRelatedSlide = 1; else _numRelatedSlide = 4; } } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { sb.AppendLine("<div class=\"SlideItMoo_element\"><a href=\"product.aspx?p=" + row["titleid"].ToString() + "\" style=\"background-color:#FFF;\"><img src=\"" + strFolder + row["imagetn"].ToString() + "\" title=\"" + row["pubname"].ToString() + " : " + row["title"].ToString() + "\" height=\"100px\" /></a><p>" + row["title"].ToString() + "</p></div>"); } } PlaceHolser_Slide.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private string Get_Title_Image_by_Id(int TitleId) { SiteProduct siteproduct = new SiteProduct(); DataSet dsProduct = siteproduct.Get_Title_by_Id(TitleId); if (dsProduct != null && dsProduct.Tables != null) { foreach (DataTable table in dsProduct.Tables) { foreach (DataRow row in table.Rows) { return row["Imagetn"].ToString(); } } } dsProduct = null; return ""; }
protected void LoadWishList() { SiteWish wishList = new SiteWish(); DataSet dswishList = new DataSet(); StringBuilder sb = new StringBuilder(); Boolean entro = false; bool share_added = false; sb.AppendLine("<div class=\"mainAccount\">"); sb.AppendLine("<h1>" + Session[SiteConstants.UserFullName] + ":<strong> Wish List</strong></h1>"); sb.AppendLine("</div>"); dswishList = wishList.Get_All_Wish_By_Session(); foreach (DataTable table in dswishList.Tables) { foreach (DataRow row in table.Rows) { if (!share_added) { //sb.AppendLine(String.Format("<a href='wishlist_share.aspx?id={0}'>Share Me</a>", row["UniqueID"])); string SocialTwistScript = "<style type='text/css'>div#bread div.iconSubmenu div.linkShare { display:none; }</style><div style='width: 100px; float: right; margin-top: -20px;margin-right:12px;'>" + Global.globalSocialTwist + "</a></div>"; string link = String.Format("http://" + Request.Url.Host.ToString() + "/wishlist_share.aspx?id={0}", row["UniqueID"]); sb.AppendLine(SocialTwistScript.Replace("window.location", "'"+link+"'")); share_added = true; } sb.AppendLine("<div class=\"prodwish\">"); sb.AppendLine("<div class=\"prodImg\">"); sb.AppendLine("<div id=\"boxContImage\" style=\"width:115px; height:115px;\">"); sb.AppendLine("<a href=\"product.aspx?p=" + row["titleid"].ToString() + "\"><img id=\"images\" style=\"width: 102px;height:127px;\" title=\"" + row["pubname"].ToString() + " : " + row["title"].ToString() + "\" src=\"" + strFolder + "tn_" + row["imageTN"].ToString() + "\"></a>"); //onload=\"getDim(document.getElementById('boxContImage'),this)\" sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodSrcDesc\">"); sb.AppendLine("<h2><a href=\"Product.aspx?p=" + row["TitleId"].ToString() + "&s=" + row["SKU"].ToString() + "\">" + row["title"].ToString() + "</a></h2>"); sb.AppendLine("<p><em>by: </em> <a href=\"result.aspx?findopt5=" + row["PubId"].ToString() + "&am=1&asm=" + 3 + "\">" + row["pubname"].ToString() + "</a></p>"); sb.AppendLine("<h3> $" + String.Format("{0:#,0.00}", row["price"]) + "</h3>"); if (Convert.ToDouble(row["youShave"].ToString()) > 0) { sb.AppendLine("<h4>Your DISCOUNTED price</h4>"); sb.AppendLine("<h5>You Save: $" + String.Format("{0:#,0.00}", row["youShave"]) + "</h5>"); } sb.AppendLine("Date Added: " + row["CreateDate"].ToString() + "<br />"); sb.AppendLine("Add Comment:<br />"); sb.AppendLine("<form action=\"wishList.aspx?w=" + row["WishListDetailId"].ToString() + "&up=1\" method=\"post\">"); sb.AppendLine("<input type=\"text\" value=\"" + row["Comment"].ToString() + " \" name=\"txt_comment\"/><br><br>"); sb.AppendLine("<input type=\"image\" src=\"" + Global.globalSiteImagesPath + "/bottonSave.jpg\"/><br><br>"); sb.AppendLine("</form>"); sb.AppendLine("</div>"); sb.AppendLine("<div class=\"prodNumber\">"); sb.AppendLine("<div class=\"prodNumCont\">"); if ((row["Plat_Win_Flag"].ToString() == "1") && (row["Plat_Mac_Flag"].ToString() == "2")) { sb.AppendLine("<p>Mac / Windows</p>"); } else { sb.AppendLine("<p>" + (row["Plat_Win_Flag"].ToString() == "1" ? "Windows" : "") + "" + (row["Plat_Mac_Flag"].ToString() == "2" ? "Mac" : "") + "</p>"); } sb.AppendLine("<div class=\"numBG\">Grades<br /><span>" + row["grades"].ToString() + "</span></div>"); sb.AppendLine("<p>Item #: " + row["SKU"].ToString() + "</p>"); sb.AppendLine("</div>"); sb.AppendLine("<a href=\"#\" id=\"A2\" class=\"mb\" title=\"\" rel=\"type:element\">" + Cart.CreateAddToCartLink("<img src=\"" + Global.globalSiteImagesPath + "/btnMovetoCart.jpg\"/>", row["titleId"].ToString(), row["SKU"].ToString(), 1, Convert.ToInt32(row["WishListId"].ToString())) + "</a>"); sb.AppendLine("<a href=\"delWish.aspx?w=" + row["WishListId"].ToString() + "&id=" + row["TitleId"].ToString() + "&sku=" + row["SKU"].ToString() + "\" rel=\"width:567,height:131,ajax:true\" id=\"mb10\" class=\"mb\" title=\"Delete Product\" onClick=\"find_div_class();\"><img src=\"" + Global.globalSiteImagesPath + "/btnDelete.jpg\" border=\"0\"></a>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); TitleId = Convert.ToInt32(row["TitleId"]); } SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); dsSitePrice = siteproduct.Get_Title_RelatedProducts(TitleId); foreach (DataTable tableProducts in dsSitePrice.Tables) { foreach (DataRow row in tableProducts.Rows) { if (entro == false){ entro = true; sb.AppendLine("<div id=\"resultControls\">"); sb.AppendLine("<h2>Similar Products</h2>"); sb.AppendLine("<div id=\"SlideItMoo_outer\">"); sb.AppendLine("<div id=\"SlideItMoo_inner\">"); sb.AppendLine("<div id=\"SlideItMoo_items\">"); } sb.AppendLine("<div class=\"SlideItMoo_element\"><a href=\"product.aspx?p=" + row["titleid"].ToString() + "\" style=\"background-color:#FFF;\"><img src=\"" + strFolder + "tn_" + row["imageTN"].ToString() + "\" title=\"" + row["PubName"].ToString() + " : " + row["title"].ToString() + "\" /></a><p>" + row["title"].ToString() + "</p></div>"); } } if (entro == true){ sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); sb.AppendLine("</div>"); } } PlaceHolder_Wish.Controls.Add(new LiteralControl(sb.ToString())); sb = null; wishList = null; dswishList = null; }
private void Get_Title_AdditionalInfo() { SiteProduct siteproduct = new SiteProduct(); DataSet dsSitePrice = new DataSet(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); //--- bool showpanel = false; //--- dsSitePrice = siteproduct.Get_Title_AdditionalInfo(TitleId); if (dsSitePrice.Tables[0].Rows.Count == 0) { AdditionalInfo1.Visible = false; AdditionalInfo2.Visible = false; opt_add.Visible = false; } foreach (DataTable table in dsSitePrice.Tables) { foreach (DataRow row in table.Rows) { if (row["AddPurchReq"].ToString().Trim() != "") { sb.AppendLine("<p><b><i>Additional Purchasing Requirements</i></b><br/><br/>" + row["AddPurchReq"].ToString() + "</p>"); showpanel = true; } //sb.AppendLine("<p>" + row["SubCategory"].ToString() + "<br/>" + row["SubCategoryDesc"].ToString() + "</p>"); if (row["WhatCustRec"].ToString().Trim() != "") { sb.AppendLine("<p><b><i>What the Customer Receives</i></b><br/><br/>" + row["WhatCustRec"].ToString() + "</p>"); showpanel = true; } if (row["AddSysReq"].ToString().Trim() != "") { sb.AppendLine("<p><b><i>Additional System Requirements</i></b><br/><br/>" + row["AddSysReq"].ToString() + "</p>"); showpanel = true; } } AdditionalInfo1.Visible = showpanel; AdditionalInfo2.Visible = showpanel; opt_add.Visible = showpanel; } PlaceHolder_AdditionalInfo.Controls.Add(new LiteralControl(sb.ToString())); dsSitePrice = null; }
private void Get_Title_by_Id() { SiteProduct siteproduct = new SiteProduct(); DataSet dsProduct = new DataSet(); //--- int _ds_nr = 0; string FlagSAP = ""; dsProduct = siteproduct.Get_Title_by_Id(TitleId, sSkuId); if (dsProduct != null) { _ds_nr = dsProduct.Tables[0].Rows.Count; } else { _ds_nr = 0; } if (_ds_nr <= 0) Response.Redirect("500error.html"); _Yousave = "0";// is = but need to convert foreach (DataTable table in dsProduct.Tables) { foreach (DataRow row in table.Rows) { _Title = row["title"].ToString(); productNameToCart = row["title"].ToString(); Product_MasterPage main = (Product_MasterPage)Page.Master; main.pageTitleBar = _Title + " - " + main.pageTitleBar; _Version = row["Version"].ToString(); _Sku = row["Sku"].ToString().Trim(); _Skudesc = row["Skudesc"].ToString(); _Pubname = row["Pubname"].ToString(); _Grades = row["Grades"].ToString(); _Plat_win_flag = row["Plat_win_flag"].ToString(); _Plat_mac_flag = row["Plat_mac_flag"].ToString(); _Srp = String.Format("{0:#,0.00}", row["Srp"]); //_Er_price = row["Er_price"].ToString(); _Er_price = String.Format("{0:#,0.00}", row["Er_price"]); //_Yousave = row["Yousave"].ToString(); _Yousave = String.Format("{0:#,0.00}", row["Yousave"]); _Imagetn = row["Imagetn"].ToString(); _Long_description = row["Long_description"].ToString(); _Short_description = row["Short_description"].ToString(); _Defaultsku = row["Defaultsku"].ToString(); _Pubid = row["Pubid"].ToString(); _Shipping_Weight_lbs = row["Shipping_Weight_lbs"].ToString(); _Shipping_Bulk_Flag = row["Shipping_Bulk_Flag"].ToString(); _Shipping_Weight_Avg_lbs = row["Shipping_Weight_Avg_lbs"].ToString(); _Student_Pricing_Flag = row["Student_Pricing_Flag"].ToString(); _Price_Rule = row["Price_Rule"].ToString(); FlagSAP = row["Student_Pricing_Flag"].ToString(); _Download_Flag = row["Download_Flag"].ToString(); _Trial_Flag = row["Trial_Flag"].ToString(); _Demo_Flag = row["Demo_Flag"].ToString(); _New_Flag = row["New_Flag"].ToString(); productTrialValidated = row["TitleTrial"].ToString(); } } if (FlagSAP != "0") { Session["SAPER"] = true; } dsProduct = null; }