Listing the source code file Songs.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PxControls;
using PxFiles;
using System.Globalization;
public partial class Songs : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
//rutina na vypnutie BackButonu v Browsery
this.Context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
this.Context.Response.Cache.SetAllowResponseInBrowserHistory(false);
if (Request.Browser.MSDomVersion.Major == 0) // Non IE Browser?)
this.Context.Response.Cache.SetNoStore();
PxCulture.CurrentCulture = new CultureInfo("en-US");
if (/*(!IsPostBack)&&*/(wquQCDTitul.Active==false))
{
wquQCDTitul.ConnectString = AppConst.ConnectString;
wquQCDTitul.SQLSelect = "select CdTitul.IDCDTITUL as IDCDTITUL, CONCAT_WS(' ',CdTitul.Titul,' / ',Author.last_name,Author.first_name) as NAME from CdTitul,Author where CdTitul.idauthor1=Author.idauthor";
wquQCDTitul.Open();
wquQCDTitul.AutomaticRefresh = true;
wquQCDTitul.IntervalQueryRefresh = 30;
wquQCDTitul.Columns["IDCDTITUL"].Caption = "";
wquQCDTitul.Columns["NAME"].Caption = "";
}
else
{
}
if (/*(!IsPostBack)&&*/(wquSongs.Active==false))
{
//rutina na vypnutie BackButonu v Browsery
this.Context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
this.Context.Response.Cache.SetAllowResponseInBrowserHistory(false);
if (Request.Browser.MSDomVersion.Major == 0) // Non IE Browser?)
this.Context.Response.Cache.SetNoStore();
filterSongs.AddParamFilter("Name", "<b>Song Title</b>", "");
filterSongs.AddParamFilter("IDCDTitul", "<b>CD Title</b>", "");
filterSongs.OrigSQLSelect = "select IdSongs, Name, IDCDTitul, IdOrder, Length from Songs";
wquSongs.ConnectString = AppConst.ConnectString;
wquSongs.SQLSelect = "select IdSongs, Name, IDCDTitul, IdOrder, Length from Songs";
wquSongs.AddParamWebQuery("IDCDTitul", "IDCDTITUL", "name", "name", "IDCDTITUL", "wquQCDTitul");
wquSongs.AddParamValidation("Name", "vtIsNotNull");
wquSongs.Open();
wquSongs.AutomaticRefresh = true;
wquSongs.IntervalQueryRefresh = 30;
wquSongs.Columns["IdSongs"].Caption = "Id Songs";
wquSongs.Columns["Name"].Caption = "Song Title";
wquSongs.Columns["IDCDTitul"].Caption = "CD Title / Author";
wquSongs.Columns["IdOrder"].Caption = "Order";
wquSongs.Columns["Length"].Caption = "The length of songs in sec.";
}
else
{
}
filterSongs.PxDataSource = wquSongs;
grdSongs.VisibleFields = "IdSongs:40;Name:120;IDCDTitul:120;IdOrder:30;Length:60";
grdSongs.PxDataSource = wquSongs;
//grdSongs.AllowSorting = true;
grdSongs.DataBind();
navSongs.PxDataSource = wquSongs;
navSongs.PxVisibleButtons = "FRNL";
}
}
Return to original page