public void PROMOTIONALLINK() { StringBuilder sb = new StringBuilder(); string URL = "", region = ""; region = Request.Form["region"]; string conn = System.Configuration.ConfigurationManager.AppSettings["gamingnetAdsenseconn"]; //new code 16/03/2015 if (region == "GB") { sb.Append(string.Format("<option value='{0}'>{1}</option>", "0", "Select GB Promotional Link")); } else { sb.Append(string.Format("<option value='{0}'>{1}</option>", "0", "Select AU Promotional Link")); } try { DataTable dt = new DataTable(); using (newsliveupdatemgmt objpromo = new newsliveupdatemgmt(conn)) { dt = objpromo.GetPromotionalLink(region); } //dt=obj.GetDataTable("SELECT LinkName+' (added '+Convert(varchar(10),Addedon,104)+')' as LinkName,shortenurl,RandomUniqueId as LinkID FROM OfferLinkManager where isactive='Y' and region='"+region+"' Order by LinkName"); if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { URL = ""; try { if (r["shortenurl"].ToString().Trim().StartsWith("f.ast.bet/go")) { URL = string.Format("http://{0}", r["shortenurl"].ToString().Trim()); } else { URL = string.Format("//www.caledonianmedia.com/promotionalstat.aspx?siteurl={0}&siteid={1}", r["LinkID"].ToString(), Session["liveupdatesiteid"].ToString()); } } catch { URL = ""; } if (URL.Length > 1) { sb.Append(string.Format("<option value='{0}'>{1}</option>", URL, r["LinkName"].ToString())); } } } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.BLL, "ajaxpost.aspx.cs RefreshCache", ex); } ltresult.Text = sb.ToString(); sb = null; }
public void FillPromoLink() { string URL = ""; string strconn = System.Configuration.ConfigurationManager.AppSettings["gamingnetAdsenseconn"]; //new code 16/03/2015 try { DataTable dt = new DataTable(); //dt=obj.GetDataTable("SELECT LinkName+' (added '+Convert(varchar(10),Addedon,104)+')' as LinkName,shortenurl,RandomUniqueId as LinkID FROM OfferLinkManager where isactive='Y' and region='GB' Order by LinkName"); using (newsliveupdatemgmt objpromo = new newsliveupdatemgmt(strconn)) { dt = objpromo.GetPromotionalLink("GB"); } if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { URL = ""; try { if (r["shortenurl"].ToString().Trim().StartsWith("f.ast.bet/go")) { URL = string.Format("http://{0}", r["shortenurl"].ToString().Trim()); } else { URL = string.Format("//www.caledonianmedia.com/promotionalstat.aspx?siteurl={0}&siteid={1}", r["LinkID"].ToString(), Session["liveupdatesiteid"].ToString()); } } catch { URL = ""; } if (URL.Length > 1) { sellink.Items.Add(new ListItem(r["LinkName"].ToString(), URL)); } } } sellink.Items.Insert(0, new ListItem("--Select--", "0")); } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.BLL, "modelIframepromotiolink.aspx.cs FillPromoLink", ex); } }
public void FillPromoLink(string region) { string URL = ""; try { DataTable dt = new DataTable(); string conn = System.Configuration.ConfigurationManager.AppSettings["gamingnetAdsenseconn"]; using (newsliveupdatemgmt objpromo = new newsliveupdatemgmt(conn)) { dt = objpromo.GetPromotionalLink(region); } if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { URL = ""; try { if (r["shortenurl"].ToString().Trim().StartsWith("f.ast.bet/go")) { URL = string.Format("http://{0}", r["shortenurl"].ToString().Trim()); } else { URL = string.Format("//www.caledonianmedia.com/promotionalstat.aspx?siteurl={0}&siteid={1}", r["LinkID"].ToString(), Session["liveupdatesiteid"].ToString()); } } catch { URL = ""; } if (URL.Length > 1) { ddlpromolink.Items.Add(new ListItem(r["LinkName"].ToString(), URL)); } } } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.BLL, "addnewliveupdate.aspx.cs FillPromoLink", ex); } }