Výpis zdrojového kódu súboru AddAuthor.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;

public partial class AddAuthor : 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();

        if ((!IsPostBack)&&(wquAuthor.Active==false))
        {
            wquAuthor.ConnectString = AppConst.ConnectString;
            wquAuthor.SQLSelect = "select IdAuthor, First_Name, Last_Name, Notice from Author";

            wquAuthor.Open();

            wquAuthor.AutomaticRefresh = true;
            wquAuthor.IntervalQueryRefresh = 30;

            wquAuthor.Columns["IdAuthor"].Caption = "Id Autor";

            wquAuthor.Columns["First_Name"].Caption = "Meno";

            wquAuthor.Columns["Last_Name"].Caption = "Priezvisko";

            wquAuthor.Columns["Notice"].Caption = "Poznámka";

        }
        else
        {

        }

       if (wquAuthor.StateQuery == PxWebQuery.eStateQuery.sqInsert)
             lblAddEditPanel.Text = "Prida autora";
       else lblAddEditPanel.Text = "Editova autora";

        edtIdAuthor.PxDataSource = wquAuthor;
        edtIdAuthor.FieldName = "IdAuthor";

        edtFirst_Name.PxDataSource = wquAuthor;
        edtFirst_Name.FieldName = "First_Name";

        edtLast_Name.PxDataSource = wquAuthor;
        edtLast_Name.FieldName = "Last_Name";

        edtNotice.PxDataSource = wquAuthor;
        edtNotice.FieldName = "Notice";
     }

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

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

Návrat na pôvodnú stránku