protected void Page_Load(object sender, EventArgs e) { try { Hashtable hash = (Hashtable)Application[Session["langcurrent"].ToString()]; blCart = hash["blcart"].ToString(); tnumber = hash["mnumber"].ToString(); } catch { } try { if (Session["ProductInCart"] != null) { ManagerProcart ManagePro = (ManagerProcart)Session["ProductInCart"]; Number = ManagePro.GetNumBerPro(); Total = ManagePro.TotalCostVND(); } str = "<span class='txt8'>" + blCart + ":</span><br />"; str += tnumber + ": <span class='txt7'>" + Number.ToString() + "</span><br />"; str += "<span class='txt7'>" + Total.ToString("N").Split('.')[0] + " (VND)</span>"; } catch { } }
public string ShowCart() { string str = ""; int numPro = ManagerCart.getLengList(); if (numPro > 0) { str = "<table border='0' cellpadding='0' cellspacing='0' width='100%'>"; string url = ""; string subsrt = ""; for (int i = 0; i < numPro; i++) { proIncart = (ProInCart)ManagerCart.GetProIndex(i); tCurrentcy = proIncart.currency; url = proIncart.urlImage; if (url.Length > 0) { if (proIncart.type == 1 || proIncart.type == 3 || proIncart.type == 4) { url = "image/img_pro/" + url; } else if (proIncart.type == 2) { url = "image/img_com/" + url; } } else { url = "image/common/notimgpro.png"; } subsrt = "<span class='text_title'>"; if (proIncart.type == 1) { subsrt += "<a href='?menu=dp&id=" + proIncart.id.ToString() + "' class='text_title'>"; } else if (proIncart.type == 3) { subsrt += "<a href='?menu=dpda&id=" + proIncart.id.ToString() + "' class='text_title'>"; } else if (proIncart.type == 4) { subsrt += "<a href='?menu=dother&id=" + proIncart.id.ToString() + "' class='text_title'>"; } else if (proIncart.type == 2) { subsrt += "<a href='?menu=dc&id=" + proIncart.id.ToString() + "' class='text_title'>"; } subsrt += proIncart.name + "</a></span><br />"; subsrt += tprice + ": <span class='price'>" + proIncart.PriceStandard() + " VND</span><br />"; subsrt += twarranty + ": <span class='price'>" + proIncart.warranty.ToString() + " " + tmonth + "</span>"; str += "<tr>"; str += "<td width='110'>"; str += "<img src='" + url + "' width='76' height='65' />"; str += "</td>"; str += "<td valign='top' align='left' width='220'>" + subsrt + "</td>"; str += "<td width='80' align='center'><input class='tnumber' type='text' id='procart" + i.ToString() + "' value='" + proIncart.number.ToString() + "' maxlength='3' /></td>"; str += "<td width='80' align='center' class='price'>" + proIncart.ValueTotal() + "</td>"; if (proIncart.type == 1) { str += "<td align='center'><img src='image/common/icon_delete.bmp' class='idelete' onclick='AddCart(" + proIncart.id.ToString() + ",11);'/></td>"; } else if (proIncart.type == 3) { str += "<td align='center'><img src='image/common/icon_delete.bmp' class='idelete' onclick='AddCart(" + proIncart.id.ToString() + ",13);'/></td>"; } else if (proIncart.type == 4) { str += "<td align='center'><img src='image/common/icon_delete.bmp' class='idelete' onclick='AddCart(" + proIncart.id.ToString() + ",14);'/></td>"; } else if (proIncart.type == 2) { str += "<td align='center'><img src='image/common/icon_delete.bmp' class='idelete' onclick='AddCart(" + proIncart.id.ToString() + ",12);'/></td>"; } str += "</tr>"; if (i < numPro - 1) { str += "<tr><td colspan='5' class='bg_line3'></td></tr>"; } } str += "<tr class='text_b2'><td width='110'></td><td valign='top' align='left' width='220'></td>"; str += "<td width='80' align='center'>" + ManagerCart.GetNumBerPro().ToString() + "</td>"; str += "<td align='left' class='price' colspan='2'>" + ManagerCart.TotalCostVND().ToString("N") + " (VND)</td>"; str += "</tr>"; str += "</table>"; } else { str = "<div style='text-align:center;'>" + nohave + "</div>"; } return(str); }