Listing the source code file AddSongs.aspx


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 AddSongs : 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))
        {
            wquSongs.ConnectString = AppConst.ConnectString;
            wquSongs.SQLSelect = "select IdSongs, Name, IDCDTitul, IdOrder, Length from Songs";

            wquSongs.AddParamWebQuery("IDCDTitul""IDCDTITUL""name""name""IDCDTITUL""wquQCDTitul");

            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
        {

        }

       if (wquSongs.StateQuery == PxWebQuery.eStateQuery.sqInsert)
             lblAddEditPanel.Text = "Add Song";
       else lblAddEditPanel.Text = "Edit  Song";

        edtIdSongs.PxDataSource = wquSongs;
        edtIdSongs.FieldName = "IdSongs";

        edtName.PxDataSource = wquSongs;
        edtName.FieldName = "Name";

        cmbIDCDTitul.PxDataSource = wquSongs;
        cmbIDCDTitul.FieldName = "IDCDTitul";

        edtIdOrder.PxDataSource = wquSongs;
        edtIdOrder.FieldName = "IdOrder";

        edtLength.PxDataSource = wquSongs;
        edtLength.FieldName = "Length";
     }

     protected void ButtonOk_Click(object sender, EventArgs e)
     {
        wquSongs.Post();
        wquSongs.GoBackPreviousPage();
     }

     protected void ButtonStorno_Click(object sender, EventArgs e)
     {
        wquSongs.Cancel();
        wquSongs.GoBackPreviousPage();
     }

}

Return to original page