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.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class felhasznalo_rogzites : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        dropDownListFeltoltesCeg();
        dropDownListFeltoltesBeosztas();
    }

    protected int cegID=0;
    protected int beosztasID = 0;
    protected string kontaktNev="";
    protected string kontaktTel = "";
    protected string kontaktFax = "";
    protected string kontaktMobil = "";
    protected string kontaktMail = "";
    protected string UserName = "";
    
    public void dropDownListFeltoltesCeg()
    {

        ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlCegvalaszt")).Items.Add("Válassz....");


        System.Collections.Generic.List<db.cegLista> cegLista = new System.Collections.Generic.List<db.cegLista>();
        db.adatbazisMuveletek.cegListaLekerdezes(out cegLista);

        for (int i = 0; i < cegLista.Count; i++)
        {
            ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlCegvalaszt")).Items.Add(new ListItem(cegLista[i].cegNev , cegLista[i].cegID.ToString()));
        }
    }
    public void dropDownListFeltoltesBeosztas()
    {

        ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlBeosztas")).Items.Add("Válassz....");
        

        System.Collections.Generic.List<db.beosztas> beosztas = new System.Collections.Generic.List<db.beosztas>();
        db.adatbazisMuveletek.beosztasLekerdez(out beosztas);

        for (int i = 0; i < beosztas.Count; i++)
        {
            ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlBeosztas")).Items.Add(new ListItem(beosztas[i].beosztasNev, beosztas[i].beosztasID.ToString()));
        }
    }
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
        cegID = ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlCegvalaszt")).SelectedIndex;
        beosztasID = ((DropDownList)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlBeosztas")).SelectedIndex;
        kontaktNev = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtNev")).Text;
        kontaktTel = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtTel")).Text;
        kontaktFax = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtFax")).Text;
        kontaktMobil = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("txtMobil")).Text;
        kontaktMail = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Email")).Text;
        kontaktMail = ((TextBox)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName")).Text;
        db.adatbazisMuveletek.kontaktRogzitCEGID(cegID, beosztasID, kontaktNev, kontaktTel, kontaktFax, kontaktMobil, kontaktMail, UserName);
    }
}
