protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["tt"])) { var oProduct = new TLLib.Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["tt"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProductName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); } else { strTitle = strMetaTitle = "Dịch Vụ Gói Quà"; strDescription = ""; strMetaDescription = ""; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["ni"])) { var oProduct = new Product(); var oProductCategory = new ProductCategory(); var dv = oProduct.ProductSelectOne(Request.QueryString["ni"]).DefaultView; if (dv != null && dv.Count <= 0) return; var row = dv[0]; var dv2 = oProductCategory.ProductCategorySelectOne(row["CategoryID"].ToString()).DefaultView; strTitle = Server.HtmlDecode(row["ProductName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); lblTitleProduct.Text = dv2[0]["ProductCategoryName"].ToString(); } else { strTitle = strMetaTitle = "Nghiên Cứu Phát Triển"; strDescription = ""; strMetaDescription = ""; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //if (((DataView)odsTinTuc.Select()).Count <= DataPager1.PageSize) //{ // DataPager1.Visible = false; //} string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["pi"])) { var oProduct = new Product(); var oProductCategory = new ProductCategory(); var dv = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView; if (dv != null && dv.Count <= 0) return; var row = dv[0]; strTitle = Server.HtmlDecode(row["ProductName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); } else { strTitle = strMetaTitle = "Sản Phẩm"; strDescription = ""; strMetaDescription = ""; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); } }
protected void txtQuantity_TextChanged(object sender, EventArgs e) { var oProduct = new Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView; lblThanhTien.Text = string.Format("{0:##,###.##}", Convert.ToDecimal(dv[0]["Price"].ToString()) * Convert.ToDecimal(txtQuantity.Text)).Replace('.', '*').Replace(',', '.').Replace('*', ','); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["pi"])) { var oProduct = new Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView; if (dv != null && dv.Count <= 0) return; var row = dv[0]; strTitle = Server.HtmlDecode(row["ProductName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); //hdnSanPham.Value = progressTitle(dv[0]["ProductCategoryName"].ToString()) + "-pci-" + dv[0]["ProductCategoryID"].ToString() + ".aspx"; } else { strTitle = strMetaTitle = "Sản phẩm"; strDescription = ""; strMetaDescription = ""; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); lblTitle.Text = strTitle; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (((DataView)odsNews.Select()).Count <= DataPager1.PageSize) { DataPager1.Visible = false; } string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["nw"])) { var oProduct = new TLLib.Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["nw"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProductNameEn"].ToString()); strDescription = Server.HtmlDecode(row["DescriptionEn"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittleEn"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescriptionEn"].ToString()); //hdnSanPham.Value = progressTitle(dv[0]["ProductCategoryName"].ToString()) + "-pci-" + dv[0]["ProductCategoryID"].ToString() + ".aspx"; } else { strTitle = strMetaTitle = "News"; strDescription = "News"; strMetaDescription = "News"; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["pi"])) { var oProductCategory = new TLLib.ProductCategory(); var oProduct = new TLLib.Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView; var dv2 = oProductCategory.ProductCategorySelectOne(Request.QueryString["pci"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProductName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); hdnSanPhamDetails.Value = progressTitle(dv2[0]["ProductCategoryName"].ToString()) + "-pci-" + dv2[0]["ProductCategoryID"].ToString() + ".aspx"; } else { strTitle = strMetaTitle = "Sản Phẩm"; strDescription = ""; strMetaDescription = ""; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); lblProductTitle.Text = strTitle; } }
protected void btnGui_Click(object sender, EventArgs e) { if (Page.IsValid) { var oOrders = new Orders(); var oOrderDetail = new OrderDetail(); var oAddressBook = new AddressBook(); var oProduct = new Product(); var dv = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView; var OrderNumber = DateTime.Now.ToString("ddMMyy") + Guid.NewGuid().GetHashCode().ToString("X").Substring(0, 4); oAddressBook.AddressBookInsert(txtFullName.Text.ToString(), "", txtEmail.Text.ToString(), txtPhone.Text.ToString(), txtPhone.Text.ToString(), "", txtEmail.Text, "", txtAddress.Text.ToString(), "", "", "", "1", dropTinhThanh.SelectedValue.ToString(), dropListQuan.SelectedValue.ToString(), "", "", "", ""); oOrders.OrdersInsert( OrderNumber, txtEmail.Text, "1", "1", "email", "1", oAddressBook.AddressBookSelectIdentCurrent().ToString(), "", "", "1", "", txtAddress.Text, "1" ); oOrderDetail.OrderDetailInsert( OrderNumber, Request.QueryString["pi"], txtQuantity.Text, dv[0]["Price"].ToString(), txtEmail.Text, "", "" ); string Body = "<div style='width: 100%; font-size: 14px; font-family: Arial;'>"; //Body += "<h3 style='color: rgb(204,102,0); font-size: 22px; border-bottom-color: gray; border-bottom-width: 1px;border-bottom-style: dashed; margin-bottom: 20px; font-family: Times New Roman;'>"; //Body += "Cảm ơn bạn đã đăng ký tham gia English Camp 2015"; //Body += "</h3>"; Body += "<p>Họ và tên: " + txtFullName.Text + "</p>"; Body += "<p>Email: " + txtEmail.Text + "</p>"; Body += "<p>Điện thoại: " + txtPhone.Text + "</p>"; //Common.SendMail("smtp.gmail.com", 587, "*****@*****.**", "iei@vnuhcm", "", "", "XÁC NHẬN ĐĂNG KÝ THAM GIA ENGLISH CAMP 2015", Body, true); ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "runtime", " $(document).ready(function () {myaccessfull('popupAcc', 'Order Infomation', 'Congratulations, you have successfully ordered !');});", true); txtFullName.Text = ""; txtPhone.Text = ""; txtEmail.Text = ""; txtQuantity.Text = ""; txtAddress.Text = ""; lblThanhTien.Text = "0"; dropTinhThanh.SelectedIndex = 0; dropListQuan.SelectedIndex = 0; } }