protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { VikkiSoft_BLL.Country c = new VikkiSoft_BLL.Country(); if (c.LoadDetailInfo(CountryID)) { lblName.Text = c.GetColumn(Country.ColumnNames.Name).ToString(); if (!c.IsColumnNull(Country.ColumnNames.CapitalID)) { hlCapital.Text = c.GetColumn("CapitalName").ToString(); hlCapital.NavigateUrl = Utils.GenerateFriendlyURL("city", new string[] { c.GetColumn("Name_en").ToString(), c.GetColumn("CapitalName_en").ToString() }); } else { pnlCapital.Visible = false; } if (!c.IsColumnNull(Country.ColumnNames.Content)) { divCountryContent.InnerHtml = c.GetColumn(Country.ColumnNames.Content).ToString(); } if (!c.IsColumnNull(Country.ColumnNames.MainImage) && c.s_MainImage.Length > 0) { pnlPageTitle.Attributes["style"] = "background-image: url(" + Master.SiteURL + Utils.GaleryImagePath.Replace("~", "") + "/" + c.MainImage + ");"; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { VikkiSoft_BLL.Country c = new VikkiSoft_BLL.Country(); if (c.LoadDetailInfo(CountryID)) { lblName.Text = c.GetColumn("Name" + Utils.LangPrefix).ToString(); if (!c.IsColumnNull(Country.ColumnNames.CapitalID)) { hlCapital.Text = c.GetColumn("CapitalName" + Utils.LangPrefix).ToString(); hlCapital.NavigateUrl = Utils.GenerateFriendlyURL("city", new string[] { c.GetColumn("Name_en").ToString(), c.GetColumn("CapitalName_en").ToString() }); } else { pnlCapital.Visible = false; } if (!c.IsColumnNull(Country.ColumnNames.Area)) { lblArea.Text = c.Area.ToString("N").Replace(".00", "") + " " + Resources.Vikkisoft.AreaMeasure; } else { pnlArea.Visible = false; } if (!c.IsColumnNull(Country.ColumnNames.Population)) { lblPopulation.Text = c.Population.ToString("N").Replace(".00", ""); } else { pnlPopulation.Visible = false; } if (!c.IsColumnNull(Country.ColumnNames.CurrencyCode)) { lblCurrency.Text = c.GetColumn("CurrencyName" + Utils.LangPrefix).ToString() + " (" + c.s_CurrencyCode + ")"; } else { pnlCurrency.Visible = false; } if (!c.IsColumnNull("Content" + Utils.LangPrefix)) { lblCountryContent.Text = c.GetColumn("Content" + Utils.LangPrefix).ToString(); } } } }
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "text/xml"; XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("urlset"); writer.WriteAttributeString("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9"); VikkiSoft_BLL.Country cont = new VikkiSoft_BLL.Country(); if (cont.LoadSiteMap()) { string siteUrl = Request.Url.Scheme + Uri.SchemeDelimiter + System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"]; if (!Request.Url.IsDefaultPort) { siteUrl += ":" + Request.Url.Port; } siteUrl += "/"; AddURL(writer, siteUrl, "Default.aspx", cont.DateUpdate); AddURL(writer, siteUrl, "Blogs.aspx", cont.DateUpdate); do { string url = ""; if (cont.GetColumn("BlogPageID").ToString() != "0") { url = Utils.GenerateFriendlyURL("page", new string[] { cont.GetColumn("BlogPageID").ToString(), cont.GetColumn("BlogPageName_en").ToString() }, false); } else if(cont.GetColumn("CityName").ToString() == "") { url = Utils.GenerateFriendlyURL("country", new string[] { cont.GetColumn("CountryName").ToString() }, false); } else{ url = Utils.GenerateFriendlyURL("city", new string[] { cont.GetColumn("CountryName").ToString(), cont.GetColumn("CityName").ToString() }, false); } AddURL(writer, siteUrl, url, cont.DateUpdate); } while (cont.MoveNext()); } writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); Response.End(); }
protected override DataTable GetDataSource() { VikkiSoft_BLL.Country c = new VikkiSoft_BLL.Country(); c.LoadWithCapital(); return c.DefaultView.Table; }