using System;
using System.Configuration;
using System.Data;
using System.Linq;
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 System.Xml.Linq;


public partial class _Default : System.Web.UI.Page 
{
    public string aktualisA="Összes";
    public string aktualisB="Összes";
    public string aktualisC="Összes";
    public string aktualisD="Összes";
    public string aktualisE = "";

    protected int cegID = 0;
    protected int arsavID = 0;
    protected double szorzo = 0;
    protected double kepzettAR = 0;

    
    protected void Page_Load(object sender, EventArgs e)
    {
        //
        string UserName = Page.User.Identity.Name;
        //
        db.adatbazisMuveletek.UserNameToCegID(UserName, out cegID);
        //
        db.adatbazisMuveletek.cegIdToArsav(cegID, out arsavID);
        //
        db.adatbazisMuveletek.ArsavLekerdez(arsavID, out szorzo);
        

        if (!Page.User.Identity.IsAuthenticated)
        {
            Response.Redirect("default_latogato.aspx");
        }
        if (!IsPostBack)
        {
            listBoxokFrissitese("Összes", "Összes", "Összes", "Összes");
            termekListaFrissites();
        }
        TextBox tbSearch = (TextBox)(Master.FindControl("tbSearch"));
        aktualisE = tbSearch.Text;
        if (Request.QueryString.Count > 0)
        {
            
        }
        if (tbSearch.Text.Length>0)
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue,@tbSearch.Text);
            termekListaFrissites(@tbSearch.Text);
        }

    }

    protected void listBoxokFrissitese(string a, string b, string c, string d)
    {

        aktualisA = a;
        aktualisB = b;
        aktualisC = c;
        aktualisD = d;

        string katName;
        lbGyarto.Items.Clear();
        lbKat2.Items.Clear();
        lbKat3.Items.Clear();
        lbKat4.Items.Clear();
        
        if (!lbGyarto.Items.Contains(new ListItem("Összes"))) { lbGyarto.Items.Add("Összes"); }
        if (!lbKat2.Items.Contains(new ListItem("Összes"))) { lbKat2.Items.Add("Összes"); }
        if (!lbKat3.Items.Contains(new ListItem("Összes"))) { lbKat3.Items.Add("Összes"); }
        if (!lbKat4.Items.Contains(new ListItem("Összes"))) { lbKat4.Items.Add("Összes"); }

        System.Collections.Generic.List<db.kategoriak2> kategoriaTomb = new System.Collections.Generic.List<db.kategoriak2>();
        db.adatbazisMuveletek.kategoriaLekerdezesek(a, b, c, d, out kategoriaTomb);
        for (int i = 0; i < kategoriaTomb.Count; i++)
        {
            db.adatbazisMuveletek.katIDToKatName(1, Convert.ToInt32(kategoriaTomb[i].kategoria1), out katName);
            if (!lbGyarto.Items.Contains(new ListItem(katName))) { lbGyarto.Items.Add(katName); }
            db.adatbazisMuveletek.katIDToKatName(2, Convert.ToInt32(kategoriaTomb[i].kategoria2), out katName);
            if (!lbKat2.Items.Contains(new ListItem(katName))) { lbKat2.Items.Add(katName); }

            db.adatbazisMuveletek.katIDToKatName(3, Convert.ToInt32(kategoriaTomb[i].kategoria3), out katName);
            if (!lbKat3.Items.Contains(new ListItem(katName))) { lbKat3.Items.Add(katName); }

            db.adatbazisMuveletek.katIDToKatName(4, Convert.ToInt32(kategoriaTomb[i].kategoria4), out katName);
            if (!lbKat4.Items.Contains(new ListItem(katName))) { lbKat4.Items.Add(katName); }

        }
       
        lbGyarto.SelectedIndex = lbGyarto.Items.IndexOf(lbGyarto.Items.FindByValue(aktualisA));
        lbKat2.SelectedIndex = lbKat2.Items.IndexOf(lbKat2.Items.FindByValue(aktualisB));
        lbKat3.SelectedIndex = lbKat3.Items.IndexOf(lbKat3.Items.FindByValue(aktualisC));
        lbKat4.SelectedIndex = lbKat4.Items.IndexOf(lbKat4.Items.FindByValue(aktualisD));
        
    }
    protected void listBoxokFrissitese(string a, string b, string c, string d,string e)
    {
        
        aktualisA = a;
        aktualisB = b;
        aktualisC = c;
        aktualisD = d;
        aktualisE = e;

        string katName;
        lbGyarto.Items.Clear();
        lbKat2.Items.Clear();
        lbKat3.Items.Clear();
        lbKat4.Items.Clear();

        if (!lbGyarto.Items.Contains(new ListItem("Összes"))) { lbGyarto.Items.Add("Összes"); }
        if (!lbKat2.Items.Contains(new ListItem("Összes"))) { lbKat2.Items.Add("Összes"); }
        if (!lbKat3.Items.Contains(new ListItem("Összes"))) { lbKat3.Items.Add("Összes"); }
        if (!lbKat4.Items.Contains(new ListItem("Összes"))) { lbKat4.Items.Add("Összes"); }

        System.Collections.Generic.List<db.kategoriak2> kategoriaTomb = new System.Collections.Generic.List<db.kategoriak2>();
        db.adatbazisMuveletek.kategoriaLekerdezesek2(a, b, c, d, e, out kategoriaTomb);
        for (int i = 0; i < kategoriaTomb.Count; i++)
        {
            db.adatbazisMuveletek.katIDToKatName(1, Convert.ToInt32(kategoriaTomb[i].kategoria1), out katName);
            if (!lbGyarto.Items.Contains(new ListItem(katName))) { lbGyarto.Items.Add(katName); }
            db.adatbazisMuveletek.katIDToKatName(2, Convert.ToInt32(kategoriaTomb[i].kategoria2), out katName);
            if (!lbKat2.Items.Contains(new ListItem(katName))) { lbKat2.Items.Add(katName); }

            db.adatbazisMuveletek.katIDToKatName(3, Convert.ToInt32(kategoriaTomb[i].kategoria3), out katName);
            if (!lbKat3.Items.Contains(new ListItem(katName))) { lbKat3.Items.Add(katName); }

            db.adatbazisMuveletek.katIDToKatName(4, Convert.ToInt32(kategoriaTomb[i].kategoria4), out katName);
            if (!lbKat4.Items.Contains(new ListItem(katName))) { lbKat4.Items.Add(katName); }

        }

        lbGyarto.SelectedIndex = lbGyarto.Items.IndexOf(lbGyarto.Items.FindByValue(aktualisA));
        lbKat2.SelectedIndex = lbKat2.Items.IndexOf(lbKat2.Items.FindByValue(aktualisB));
        lbKat3.SelectedIndex = lbKat3.Items.IndexOf(lbKat3.Items.FindByValue(aktualisC));
        lbKat4.SelectedIndex = lbKat4.Items.IndexOf(lbKat4.Items.FindByValue(aktualisD));

    }
    protected void lbGyarto_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (aktualisE.Length > 0)
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue, @aktualisE);
            termekListaFrissites(@aktualisE);
        }
        else
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
            termekListaFrissites();
        }

    }
    protected void lbKat2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (aktualisE.Length > 0)
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue, @aktualisE);
            termekListaFrissites(@aktualisE);
        }
        else
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
            termekListaFrissites();
        }
    }
    protected void lbKat3_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (aktualisE.Length > 0)
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue, @aktualisE);
            termekListaFrissites(@aktualisE);
        }
        else
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
            termekListaFrissites();
        }
    }
    protected void lbKat4_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (aktualisE.Length > 0)
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue, @aktualisE);
            termekListaFrissites(@aktualisE);
        }
        else
        {
            listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
            termekListaFrissites();
        }
    }

    protected void termekListaFrissites()
    {
        
        Panel3.Controls.Clear();
        
        System.Collections.Generic.List<db.termekLista> termekLista = new System.Collections.Generic.List<db.termekLista>();
        db.adatbazisMuveletek.termekListaLekerdezes(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue,out termekLista);
        
        for (int j = 0; j < termekLista.Count; j++)
        {
            //float kepzettAr = 0;
            //int felhasznaloID = Page.User.Identity.Name;
            Label cikkszam = new Label();
            cikkszam.Text = termekLista[j].cikkszam;
            cikkszam.Font.Bold = true;
            cikkszam.ID = "lblCikkszam0" + j.ToString();
            Label megnevezes = new Label();
            megnevezes.Text = "               Megnevezés: "+termekLista[j].megnevezes;
            Label termekleiras = new Label();
            megnevezes.ID = "megnevezes0" + j.ToString();
            termekleiras.Text = termekLista[j].termekleiras;
            termekleiras.Font.Bold = true;
            termekleiras.ID = "termekleiras0" + j.ToString();
            Label ar = new Label();
            kepzettAR = termekLista[j].ar * szorzo;
            ar.Font.Bold = true;
            
            if (termekLista[j].ar == 0)
            {
                ar.Text = "Ár: N/A";
            }
            //adatbázis lekérdezés page.user.identytti.name  ből csinálok felhasználó ID-t ez alapján lekérdezem az ársávot
            //int megjelenítendő ár = terméklista[j].ar x ársávval
            else
            {
                ar.Text = "Ár: " + kepzettAR.ToString() + "  HUF";
            }

            
            ar.ID = "ar0" + j.ToString();
            ImageButton imgbtn = new ImageButton();
            imgbtn.ID = termekLista[j].termekID.ToString();
            imgbtn.Attributes.Add("onclick", "return false");
            imgbtn.OnClientClick = "window.open('kosarbaTesz.aspx?termekID=" + termekLista[j].termekID.ToString() + "','orderWindow"+DateTime.Now.Millisecond.ToString()+"','location=0,status=0,scrollbars=0,width=600,height=350');";
            if (j % 2 == 0)
            {
                imgbtn.ImageUrl = "~/img/kosar2.gif";
            }
            else
            {
                imgbtn.ImageUrl = "~/img/kosar.gif";
            }

            CheckBox cb = new CheckBox();
            cb.ID = "cb0" + j.ToString();
            cb.Enabled = false;
            //imgbtn.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
            imgbtn.Width = System.Web.UI.WebControls.Unit.Pixel(22);
            imgbtn.Height = System.Web.UI.WebControls.Unit.Pixel(18);
            //imgbtn.BorderStyle = BorderStyle.Solid;
            //imgbtn.BorderColor = System.Drawing.Color.Blue;

            ImageButton imgPic = new ImageButton();
            imgPic.ID = "imgPic0" + j.ToString();
            imgPic.Width = System.Web.UI.WebControls.Unit.Pixel(100);
            imgPic.Height = System.Web.UI.WebControls.Unit.Pixel(100);
            imgPic.Attributes.Add("onclick", "return false");
            imgPic.OnClientClick = "window.open('img/"+termekLista[j].imgPic+"','orderWindow" + DateTime.Now.Millisecond.ToString() + "','location=0,status=0,scrollbars=0');";
            if (termekLista[j].imgPic == "")
            {
                imgPic.ImageUrl = "~/img/noPic.jpg";
                imgPic.Enabled = false;
            }
            else
            {
                imgPic.ImageUrl = "~/img/"+termekLista[j].imgPic;
                //imgPic.PostBackUrl = "~/img/" + termekLista[j].imgPic;
            }
            Panel panel = new Panel();
            panel.ID="panel0"+j.ToString();
            //panel.Height = System.Web.UI.WebControls.Unit.Pixel(0);
            Panel panelh = new Panel();
            panelh.ID = "panelh" + j.ToString();
            //panelh.Height = System.Web.UI.WebControls.Unit.Pixel(0);
            if (j % 2 == 0)
            {
                panel.CssClass = "cpBody";
                panelh.BackColor = System.Drawing.Color.Lavender;
            }
            else
            {
                panel.CssClass = "cpBodyInverse";
                panelh.BackColor = System.Drawing.Color.White;
            }
            
            Table table = new Table();
            table.Width = System.Web.UI.WebControls.Unit.Pixel(820);
            table.BorderStyle = BorderStyle.None;
            TableRow tRow = new TableRow();
            TableRow tRow2 = new TableRow();
            TableCell tCell1 = new TableCell();
            TableCell tCell2 = new TableCell();
            TableCell tCell3 = new TableCell();
            TableCell tCell4 = new TableCell();
            TableCell tCell5 = new TableCell();
            TableCell tCell6 = new TableCell();
            TableCell tCell7 = new TableCell();

            Image imgCppe = new Image();
            imgCppe.ID = "imgCppe0" + j.ToString();
            imgCppe.Height = System.Web.UI.WebControls.Unit.Pixel(10);
            imgCppe.Width = System.Web.UI.WebControls.Unit.Pixel(10);
            panelh.Controls.Add(imgCppe);
            panelh.Controls.Add(cikkszam);
            tCell1.Width = System.Web.UI.WebControls.Unit.Pixel(200);
            tCell1.Controls.Add(panelh);
            tRow.Controls.Add(tCell1);
            tCell2.Controls.Add(megnevezes);
            tRow.Controls.Add(tCell2);
            tRow.Controls.Add(tCell6);
            tCell7.HorizontalAlign = HorizontalAlign.Right;
            tCell7.VerticalAlign = VerticalAlign.Middle;
            tCell7.Controls.Add(cb);
            tCell7.Controls.Add(imgbtn);
            tRow.Controls.Add(tCell7);
            tCell4.Controls.Add(imgPic);
            tRow2.Controls.Add(tCell4);
            tCell3.Controls.Add(termekleiras);
            tRow2.Controls.Add(tCell3);
            tCell5.Controls.Add(ar);
            //tCell5.Controls.Add(imgbtn);
            tRow2.Controls.Add(tCell5);
            table.Controls.Add(tRow);
            table.Controls.Add(tRow2);
            panel.Controls.Add(table);
            AjaxControlToolkit.CollapsiblePanelExtender cppe = new AjaxControlToolkit.CollapsiblePanelExtender();
            cppe.ID = "cppe0" + j.ToString();
            cppe.TargetControlID = "panel0" + j.ToString();
            cppe.ExpandControlID = "panelh" + j.ToString();
            cppe.CollapseControlID = "panelh" + j.ToString();
            cppe.CollapsedText = cikkszam.Text;
            cppe.ImageControlID = "imgCppe0"+j.ToString();
            cppe.CollapsedImage = "~/img/closed.jpg";
            cppe.ExpandedImage = "~/img/open.jpg";
            cppe.AutoCollapse = false;
            cppe.TextLabelID = "lblCikkszam0" + j.ToString();
            cppe.ExpandedText = cikkszam.Text;
            cppe.CollapsedSize = 24;
            cppe.Collapsed = true;

            //int magassag; magassag = Convert.ToInt32(Panel3.Height.Value); magassag += 20;
            //Panel3.Height = System.Web.UI.WebControls.Unit.Pixel(magassag); ;
            Panel3.Controls.Add(panel);
            Panel3.Controls.Add(cppe);
        }

       
    }
    protected void termekListaFrissites(string tbSearch)
    {

        Panel3.Controls.Clear();

        System.Collections.Generic.List<db.termekLista> termekLista = new System.Collections.Generic.List<db.termekLista>();
        db.adatbazisMuveletek.termekListaLekerdezes2(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue, tbSearch, out termekLista);

        for (int j = 0; j < termekLista.Count; j++)
        {
            Label cikkszam = new Label();
            cikkszam.Text = termekLista[j].cikkszam;
            cikkszam.Font.Bold = true;
            cikkszam.ID = "lblCikkszam0" + j.ToString();
            Label megnevezes = new Label();
            megnevezes.Text = "               Megnevezés: " + termekLista[j].megnevezes;
            Label termekleiras = new Label();
            megnevezes.ID = "megnevezes0" + j.ToString();
            termekleiras.Text = termekLista[j].termekleiras;
            termekleiras.Font.Bold = true;
            termekleiras.ID = "termekleiras0" + j.ToString();
            Label ar = new Label();
            kepzettAR = termekLista[j].ar * szorzo;
            if (termekLista[j].ar == 0)
            {
                ar.Text = "Ár: N/A";
            }
            else
            {
                ar.Text = "Ár: " + kepzettAR.ToString() +"  HUF";
            }

            ar.ID = "ar0" + j.ToString();
            ImageButton imgbtn = new ImageButton();
            imgbtn.ID = termekLista[j].termekID.ToString();
            imgbtn.Attributes.Add("onclick", "return false");
            imgbtn.OnClientClick = "window.open('kosarbaTesz.aspx?termekID=" + termekLista[j].termekID.ToString() + "','orderWindow" + DateTime.Now.Millisecond.ToString() + "','location=0,status=0,scrollbars=0,width=600,height=350');";
            if (j % 2 == 0)
            {
                imgbtn.ImageUrl = "~/img/kosar2.gif";
            }
            else
            {
                imgbtn.ImageUrl = "~/img/kosar.gif";
            }

            CheckBox cb = new CheckBox();
            cb.ID = "cb0" + j.ToString();
            cb.Enabled = false;
            //imgbtn.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
            imgbtn.Width = System.Web.UI.WebControls.Unit.Pixel(22);
            imgbtn.Height = System.Web.UI.WebControls.Unit.Pixel(18);
            //imgbtn.BorderStyle = BorderStyle.Solid;
            //imgbtn.BorderColor = System.Drawing.Color.Blue;

            ImageButton imgPic = new ImageButton();
            imgPic.ID = "imgPic0" + j.ToString();
            imgPic.Width = System.Web.UI.WebControls.Unit.Pixel(100);
            imgPic.Height = System.Web.UI.WebControls.Unit.Pixel(100);
            imgPic.Attributes.Add("onclick", "return false");
            imgPic.OnClientClick = "window.open('img/" + termekLista[j].imgPic + "','orderWindow" + DateTime.Now.Millisecond.ToString() + "','location=0,status=0,scrollbars=0');";
            if (termekLista[j].imgPic == "")
            {
                imgPic.ImageUrl = "~/img/noPic.jpg";
                imgPic.Enabled = false;
            }
            else
            {
                imgPic.ImageUrl = "~/img/" + termekLista[j].imgPic;
                //imgPic.PostBackUrl = "~/img/" + termekLista[j].imgPic;
            }
            Panel panel = new Panel();
            panel.ID = "panel0" + j.ToString();
            //panel.Height = System.Web.UI.WebControls.Unit.Pixel(0);
            Panel panelh = new Panel();
            panelh.ID = "panelh" + j.ToString();
            //panelh.Height = System.Web.UI.WebControls.Unit.Pixel(0);
            if (j % 2 == 0)
            {
                panel.CssClass = "cpBody";
                panelh.BackColor = System.Drawing.Color.Lavender;
            }
            else
            {
                panel.CssClass = "cpBodyInverse";
                panelh.BackColor = System.Drawing.Color.White;
            }

            Table table = new Table();
            table.Width = System.Web.UI.WebControls.Unit.Pixel(820);
            table.BorderStyle = BorderStyle.None;
            TableRow tRow = new TableRow();
            TableRow tRow2 = new TableRow();
            TableCell tCell1 = new TableCell();
            TableCell tCell2 = new TableCell();
            TableCell tCell3 = new TableCell();
            TableCell tCell4 = new TableCell();
            TableCell tCell5 = new TableCell();
            TableCell tCell6 = new TableCell();
            TableCell tCell7 = new TableCell();

            Image imgCppe = new Image();
            imgCppe.ID = "imgCppe0" + j.ToString();
            imgCppe.Height = System.Web.UI.WebControls.Unit.Pixel(10);
            imgCppe.Width = System.Web.UI.WebControls.Unit.Pixel(10);
            panelh.Controls.Add(imgCppe);
            panelh.Controls.Add(cikkszam);
            tCell1.Width = System.Web.UI.WebControls.Unit.Pixel(200);
            tCell1.Controls.Add(panelh);
            tRow.Controls.Add(tCell1);
            tCell2.Controls.Add(megnevezes);
            tRow.Controls.Add(tCell2);
            tRow.Controls.Add(tCell6);
            tCell7.HorizontalAlign = HorizontalAlign.Right;
            tCell7.VerticalAlign = VerticalAlign.Middle;
            tCell7.Controls.Add(cb);
            tCell7.Controls.Add(imgbtn);
            tRow.Controls.Add(tCell7);
            tCell4.Controls.Add(imgPic);
            tRow2.Controls.Add(tCell4);
            tCell3.Controls.Add(termekleiras);
            tRow2.Controls.Add(tCell3);
            tCell5.Controls.Add(ar);
            //tCell5.Controls.Add(imgbtn);
            tRow2.Controls.Add(tCell5);
            table.Controls.Add(tRow);
            table.Controls.Add(tRow2);
            panel.Controls.Add(table);
            AjaxControlToolkit.CollapsiblePanelExtender cppe = new AjaxControlToolkit.CollapsiblePanelExtender();
            cppe.ID = "cppe0" + j.ToString();
            cppe.TargetControlID = "panel0" + j.ToString();
            cppe.ExpandControlID = "panelh" + j.ToString();
            cppe.CollapseControlID = "panelh" + j.ToString();
            cppe.CollapsedText = cikkszam.Text;
            cppe.ImageControlID = "imgCppe0" + j.ToString();
            cppe.CollapsedImage = "~/img/closed.jpg";
            cppe.ExpandedImage = "~/img/open.jpg";
            cppe.AutoCollapse = false;
            cppe.TextLabelID = "lblCikkszam0" + j.ToString();
            cppe.ExpandedText = cikkszam.Text;
            cppe.CollapsedSize = 24;
            cppe.Collapsed = true;

            //int magassag; magassag = Convert.ToInt32(Panel3.Height.Value); magassag += 20;
            //Panel3.Height = System.Web.UI.WebControls.Unit.Pixel(magassag); ;
            Panel3.Controls.Add(panel);
            Panel3.Controls.Add(cppe);
        }


    }



    protected void CheckBox3_CheckedChanged(object sender, EventArgs e)
    {
        listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
        termekListaFrissites();
    }
    protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
    {
        listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
        termekListaFrissites();
    }
    protected void CheckBox4_CheckedChanged(object sender, EventArgs e)
    {
        listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
        termekListaFrissites();
    }
    protected void CheckBox5_CheckedChanged(object sender, EventArgs e)
    {
        listBoxokFrissitese(lbGyarto.SelectedValue, lbKat2.SelectedValue, lbKat3.SelectedValue, lbKat4.SelectedValue);
        termekListaFrissites();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        listBoxokFrissitese("Összes", "Összes", "Összes", "Összes");
        termekListaFrissites();
    }
}
