private void LoadDropDownListPageLink() { ddlLink.Items.Clear(); ddlLink.Items.Add(new ListItem("Trang chủ", "/")); DataTable dt = new DataTable(); dt = GroupNewsService.GroupNews_GetByTop("", "Active=1", "Level, Ord"); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["Index"].ToString() == "0") { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["Level"].ToString()), PageHelper.GeneralGroupUrl(Consts.CON_TIN_TUC, dt.Rows[i]["Id"].ToString(), dt.Rows[i]["Name"].ToString()))); } else { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["Level"].ToString()), PageHelper.GeneralGroupUrl(Consts.CON_VAN_BAN, dt.Rows[i]["Id"].ToString(), dt.Rows[i]["Name"].ToString()))); } } List <Data.GroupImages> listG = GroupImagesService.GroupImages_GetByTop("", "Active=1", "Level, Ord"); if (listG.Count > 0) { for (int i = 0; i < listG.Count; i++) { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(listG[i].Name, listG[i].Level), "/thu-vien-anh/" + listG[i].Id + "/" + StringClass.NameToTag(listG[i].Name))); } } ddlLink.Items.Add(new ListItem("Liên hệ", "/lien-he")); ddlLink.Items.Add(new ListItem("Videos", "/video-hoi")); ddlLink.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (Page.RouteData.Values["GroupId"] != null) { GroupId = Page.RouteData.Values["GroupId"] as string; } if (Lang == "en") { Page.Title = "VietNam Association Of Social Psychology"; } else { Page.Title = "Hội Tâm Lý Học Xã Hội Việt Nam"; } if (!IsPostBack) { if (Request.Cookies["CurrentLanguage"] != null) { Lang = Request.Cookies["CurrentLanguage"].Value; } List <GroupImages> listGrp = GroupImagesService.GroupImages_GetByTop("", "Active=1 AND Language='" + Lang + "'", "Ord"); if (listGrp.Count > 0) { if (string.IsNullOrEmpty(GroupId)) { GroupId = listGrp[0].Id; } for (int i = 0; i < listGrp.Count; i++) { if (listGrp[i].Id == GroupId) { GroupName = listGrp[i].Name; Page.Title = GroupName; break; } } rptGroupImages.DataSource = listGrp; rptGroupImages.DataBind(); List <Data.Images> listImages = ImagesService.Images_GetByTop("", "Active = 1 AND GroupId = '" + GroupId + "'", "Ord"); for (int i = 0; i < listImages.Count; i++) { //ltrImages.Text += "<a href=http://unitegallery.net>\n"; ltrImages.Text += "<img alt='" + GroupName + "'\n"; ltrImages.Text += "src='" + StringClass.ThumbImage(listImages[i].Image) + "'\n"; ltrImages.Text += "data-image='" + listImages[i].Image + "'\n"; ltrImages.Text += "style='display:none'>"; } } } } catch (Exception ex) { MailSender.SendMail("", "", "Error System", ex.Message); } }
protected void LoadDropDownListGroupImage() { ddlGroupImage.Items.Clear(); drlnhom.Items.Clear(); ddlGroupImage.Items.Add(new ListItem("--Chọn nhóm hình ảnh--", "")); drlnhom.Items.Add(new ListItem("--Chọn nhóm hình ảnh--", "0")); List <Data.GroupImages> listImg = new List <Data.GroupImages>(); listImg = GroupImagesService.GroupImages_GetByTop("", "Active = 1", ""); for (int i = 0; i < listImg.Count; i++) { ddlGroupImage.Items.Add(new ListItem(Common.StringClass.ShowNameLevel(listImg[i].Name, listImg[i].Level), listImg[i].Id)); drlnhom.Items.Add(new ListItem(Common.StringClass.ShowNameLevel(listImg[i].Name, listImg[i].Level), listImg[i].Id)); } ddlGroupImage.DataBind(); drlnhom.DataBind(); }
private void LoadDropDownListPageLink() { ddlLink.Items.Clear(); ddlLink.Items.Add(new ListItem("Trang chủ", "/")); DataTable dt = new DataTable(); dt = GroupNewsService.GroupNews_GetByTop("", "Active=1", "Level, Ord"); ddlLink.Items.Add(new ListItem("Tin tức", "#")); for (int i = 0; i < dt.Rows.Count; i++) { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["Level"].ToString() + "00000"), PageHelper.GeneralGroupUrl(Consts.CON_TIN_TUC, dt.Rows[i]["Id"].ToString(), dt.Rows[i]["Name"].ToString()))); } List <Data.GroupImages> listG = GroupImagesService.GroupImages_GetByTop("", "Active=1", "Level, Ord"); ddlLink.Items.Add(new ListItem("Hình ảnh", "#")); if (listG.Count > 0) { for (int i = 0; i < listG.Count; i++) { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(listG[i].Name, listG[i].Level + "00000"), "/Thu-vien-anh/" + listG[i].Id + "/" + StringClass.NameToTag(listG[i].Name))); } } DataTable listGProduct = GroupProductService.GroupProduct_GetByTop("", "Active=1", "Level, Ord"); ddlLink.Items.Add(new ListItem("Sản phẩm", "#")); if (listGProduct.Rows.Count > 0) { for (int i = 0; i < listGProduct.Rows.Count; i++) { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(listGProduct.Rows[i]["Name"].ToString(), listGProduct.Rows[i]["Level"].ToString() + "00000"), PageHelper.GeneralGroupUrl(Consts.CON_SAN_PHAM, listGProduct.Rows[i]["Id"].ToString(), listGProduct.Rows[i]["Name"].ToString()))); } } DataTable listChude = ChudeService.Chude_GetByTop("", "Active=1", "Ord"); ddlLink.Items.Add(new ListItem("Chủ đề", "#")); if (listChude.Rows.Count > 0) { for (int i = 0; i < listChude.Rows.Count; i++) { ddlLink.Items.Add(new ListItem(StringClass.ShowNameLevel(listChude.Rows[i]["Name"].ToString(), "0000000000"), "/chu-de/chu-de-" + listChude.Rows[i]["Id"].ToString() + "/" + StringClass.NameToTag(listChude.Rows[i]["Name"].ToString()))); } } ddlLink.Items.Add(new ListItem("Liên hệ", "/lien-he")); ddlLink.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (Page.RouteData.Values["GroupId"] != null) { GroupId = Page.RouteData.Values["GroupId"] as string; } if (!IsPostBack) { List <GroupImages> listGrp; if (GroupId != null) { listGrp = GroupImagesService.GroupImages_GetByTop("", "Active=1", "Ord"); } else { listGrp = GroupImagesService.GroupImages_GetById(GroupId); } if (listGrp.Count > 0) { groupName = listGrp[0].Name; List <Data.Images> listImages = ImagesService.Images_GetByTop("", "Active = 1 AND GroupId = '" + listGrp[0].Id + "'", "Ord"); for (int i = 0; i < listImages.Count; i++) { ltrImages.Text += "<a href=#>\n"; ltrImages.Text += "<img alt='" + groupName + "'\n"; ltrImages.Text += "src='" + StringClass.ThumbImage(listImages[i].Image) + "'\n"; ltrImages.Text += "data-image='" + listImages[i].Image + "'\n"; ltrImages.Text += "style='display:none'></a>"; } } } } catch (Exception ex) { MailSender.SendMail("", "", "Error System", ex.Message + "\n" + ex.StackTrace); } }