using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class MasterPage : System.Web.UI.MasterPage
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Page.User.Identity.IsAuthenticated) //ha be van jelentkezve
        {
            //
            string UserName = Page.User.Identity.Name;
            int cegID;
            db.cegLista cegAdatok = new db.cegLista();
            db.disztriKontakt disztriKontakt = new db.disztriKontakt();
            //
            db.adatbazisMuveletek.UserNameToCegID(UserName, out cegID);
            db.adatbazisMuveletek.cegAdatokLekerdezes(cegID, out cegAdatok);
            db.adatbazisMuveletek.termekmanagerLekerdezes(Convert.ToInt32(cegAdatok.disztriKontaktID), out disztriKontakt);
            Panel1.Height = System.Web.UI.WebControls.Unit.Pixel(120);
            pnlLogin1.Visible = true;
            Login1.Visible = false;
            Menu1.Visible = true;
            Menu3.Visible = false;
            lblCegnev.Text = cegAdatok.cegNev;
            lblKapcsolattarto.Text = disztriKontakt.nev;
            lblkontaktTel4.Text = disztriKontakt.mobil;
            lblKontaktMail.Text = disztriKontakt.mail;
       
        }
        else //ha nincs bejelentkezve
        {
            Panel1.Height = System.Web.UI.WebControls.Unit.Pixel(80);
            pnlLogin.Visible = false;
            Login1.Visible = true;
            Menu1.Visible = false;
            Menu3.Visible = true;
        }
        
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        
    }
    protected void tbSearch_TextChanged(object sender, EventArgs e)
    {
        
    }
    protected void LinkButton5_Click(object sender, EventArgs e)
    {
        ModalPopupExtender1.Show();
    }
}
