protected void Page_Load(object sender, EventArgs e) { _zonecurrent = ZoneUtility.GetZoneCurrent(); var source = ZoneDB.GetByParentID(_zonecurrent); if (source.Rows.Count == 0) { pntSub.Visible = false; var zoneInfo = ZoneDB.GetInfo(_zonecurrent); if (zoneInfo != null) { pnZoneName.Visible = true; litZoneName.Text = zoneInfo.Zone_Name; var listStyle = zoneInfo.Zone_ContentListingDisplay; if (listStyle == "one") { PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsFocus.ascx")); } else { PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsList.ascx")); } } else { Response.Redirect("/"); } } else { rptData.DataSource = source; rptData.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { zoneCurrent = ZoneUtility.GetZoneCurrent(); lnkDownload.NavigateUrl = AppEnv.DownloadBrochure; rptData.DataSource = ZoneDB.GetByParentID(zoneCurrent); rptData.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { _zonecurrent = ZoneUtility.GetZoneCurrent(); var zoneKhoahoc = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguageFrontEnd())); lnkZoneName.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneKhoahoc); rptData.DataSource = ZoneDB.GetByParentID(zoneKhoahoc); rptData.DataBind(); }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; //HyperLink lnkZone = (HyperLink)e.Item.FindControl("lnkZone"); var litZone = (Literal)e.Item.FindControl("litZone"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var litDescription = (Literal)e.Item.FindControl("litDescription"); var rptSub2 = (Repeater)e.Item.FindControl("rptSub2"); //if (curData["Zone_ID"].ToString() == zoneCurrent.ToString()) lnkZone.CssClass = "selected"; //if (zoneCurrent == 0) //{ // if (curData["Zone_ID"].ToString() == zoneHome.ToString()) lnkZone.CssClass = "selected"; //} //if (curData["Zone_RealUrl"].ToString().Length > 0) // lnkZone.NavigateUrl = curData["Zone_RealUrl"].ToString(); //else // lnkZone.NavigateUrl = ZoneUtility.BuildUrlByZoneCurrent(ConvertUtility.ToInt32(curData["Zone_ID"])); litDescription.Text = curData["Zone_Description"].ToString(); litZone.Text = curData["Zone_Name"].ToString(); var avatar = curData["Zone_Avatar"].ToString().Trim(); if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 35, 0); } else { imgAvatar.Visible = false; } var dtSub = ZoneDB.GetByParentID(ConvertUtility.ToInt32(curData["Zone_ID"])); if (dtSub.Rows.Count == 0) { rptSub2.Visible = false; } else { rptSub2.DataSource = dtSub; rptSub2.ItemDataBound += new RepeaterItemEventHandler(rptSub2_ItemDataBound); rptSub2.DataBind(); } } }
protected void lstZones_SelectedIndexChanged(object sender, EventArgs e) { int zoneID = ConvertUtility.ToInt32(lstZones.SelectedValue); zoneSelected = zoneID; DataTable data = ZoneDB.GetByParentID(zoneID); LoadPrioritys(data); dtgZones.DataSource = data; dtgZones.DataBind(); LoadInfo(zoneID); }
public static void LoadZonesByParentID(ListItemCollection lstZones, int _zoneParentID) { lstZones.Clear(); DataTable dtItems = ZoneDB.GetByParentID(_zoneParentID); foreach (DataRow row in dtItems.Rows) { ListItem item = new ListItem(); item.Value = row["Zone_ID"].ToString(); item.Text = row["Zone_Name"].ToString(); item.Attributes.Add("Level", "0"); lstZones.Add(item); LoadZoneItems(lstZones, item); } }
protected void Page_Load(object sender, EventArgs e) { zoneCurrent = ZoneUtility.GetZoneCurrent(); var source = ZoneDB.GetByParentID(zoneCurrent); if (source.Rows.Count == 0) { var zoneparent = ZoneDB.GetParentID(zoneCurrent); if (zoneparent != 0) { source = ZoneDB.GetByParentID(zoneparent); } } rptData.DataSource = source; rptData.DataBind(); }
private static void LoadZoneItems(ListItemCollection lstZones, ListItem curItem) { int level = Convert.ToInt32(curItem.Attributes["Level"]); level += 1; int curZoneID = ConvertUtility.ToInt32(curItem.Value); DataTable dtChildItems = ZoneDB.GetByParentID(curZoneID); foreach (DataRow row in dtChildItems.Rows) { ListItem childItem = new ListItem(); childItem.Text = MiscUtility.StringIndent(level) + row["Zone_Name"]; childItem.Value = row["Zone_ID"].ToString(); childItem.Attributes.Add("Level", level.ToString()); lstZones.Add(childItem); LoadZoneItems(lstZones, childItem); } }
protected void Page_Load(object sender, EventArgs e) { _zonecurrent = ZoneUtility.GetZoneCurrent(); lnkZone.Text = ZoneDB.GetZoneNameByID(_zonecurrent); lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zonecurrent); var source = ZoneDB.GetByParentID(_zonecurrent); if (source.Rows.Count > 0) { Subcategory_Full_2level1.Visible = true; KhoaHoc_List1.Visible = false; Subcategory_2level_Center1.Visible = true; } else { Subcategory_Full_2level1.Visible = false; KhoaHoc_List1.Visible = true; Subcategory_2level_Center1.Visible = false; } }