Listing the source code file Adresar.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;
 
 
public partial class Adresar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((!IsPostBack) && (wquObec.Active == false))
        {
            wquObec.ConnectString = "Database=db;Data Source=localhost;User Id=root;Password=aa21aa;";
            wquObec.SQLSelect = @"SELECT COBEC.ID_OBEC AS IDOBEC, COBEC.NAZOV_OBEC AS OBEC, 
                                 COBEC.ID_OKRES AS IDOKRES, COKRES.NAZOV_OKRES AS OKRES,
                                 COBEC.ID_KRAJ AS IDKRAJ,CKRAJ.NAZOV_KRAJ AS KRAJ 
                                 FROM 
                                     COBEC,COKRES,CKRAJ 
                                 WHERE COBEC.ID_OKRES=COKRES.ID_OKRES AND 
                                     COBEC.ID_KRAJ=CKRAJ.ID_KRAJ";
 
            wquObec.Open();
 
            wquObec.Columns["IDOBEC"].Caption = "Id Obec";
            wquObec.Columns["OBEC"].Caption = "Obec";
            wquObec.Columns["IDOKRES"].Caption = "Id Okres";
            wquObec.Columns["OKRES"].Caption = "Okres";
            wquObec.Columns["IDKRAJ"].Caption = "Id Kraj";
            wquObec.Columns["KRAJ"].Caption = "Kraj";
        }
        else
        {
        }
              
        if ((!IsPostBack)&&(wquAdresar.Active==false))
        {
            string sSQLText1 = "SELECT IDPRAVFORM AS aKEY, NAME AS aVALUE FROM PRAVFORM ORDER BY NAME";
 
            wquAdresar.ConnectString = "Database=db;Data Source=localhost;User Id=root;Password=aa21aa;";
            wquAdresar.SQLSelect = "SELECT IDADRESAR , NAME, ADDRESS, IDPRAVNAFORMA, CREATE_DATE, INVALID_ADRESS, IDKRAJ, IDOKRES, IDOBEC FROM ADRESAR03";
            
            wquAdresar.AddParamKey("IDPRAVNAFORMA", "aKEY", "aVALUE", "aVALUE", "aKEY", sSQLText1);
            wquAdresar.AddParamCheck("INVALID_ADRESS", "A", "N", false);
            wquAdresar.AddParamFlyComboBox("miesto", "idkraj;idokres;idobec", "idkraj;idokres;idobec", "kraj;okres;obec",
                                            "Obec;Okres;Kraj", "wquObec", "mvNameAndBR");
            //wquSposOsoba.AddParamFlyComboBox("Miesto1", "IDKraj1;IDOKRES1;IDOBEC1", "IDKRAJ;IDOKRES;IDOBEC", "KRAJ;OKRES;OBEC", "OBEC;OKRES", "wquObec", "mvStandard");
 
            wquAdresar.Open(); 
 
            wquAdresar.Columns["idadresar"].Caption = "ID";          
            wquAdresar.Columns["name"].Caption = "Meno Osoby";          
            wquAdresar.Columns["idpravnaforma"].Caption = "Právna Forma";
            wquAdresar.Columns["address"].Caption = "Ulica";  
            wquAdresar.Columns["create_date"].Caption = "Dátum založenia";
            wquAdresar.Columns["invalid_adress"].Caption = "Adresa neplatná";
            wquAdresar.Columns["miesto"].Caption = "Obec, Okres"; 
                    
        }
        else
        {          
        }
            grdAdresar.PxDataSource = wquAdresar;
            grdAdresar.DataBind();
    }
}


Return to original page