protected void Page_Load(object sender, EventArgs e)
        {
            controlFichero = new ControladorFicheros();
            total = this.Request.QueryString["total"];
            email = this.Request.QueryString["cliente"];

            c = controlFichero.getCliente(email, ruta);

            this.lblPrecioTotal.Text = total;
            this.lblDireccion.Text = c.Direccion;
            this.lblCliente.Text = c.Nombre;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ContentPlaceHolder holder = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
            //Leer fichero y cargar provincias en
            //drop down (con controlador ficheros)

            if (this.IsPostBack)
            {

                foreach (string clave in this.Request.Params.Keys)
                {
                    string claveRequest = this.Request.Params[clave];

                    if (clave.Contains("btnAceptar"))
                    {
                        if (this.dropProvincias.SelectedValue == "Madrid")
                        {
                            this.Response.Redirect("DondeSupermercados.aspx");

                        }
                    }
                    if (claveRequest.Contains("linkInicio"))
                    {
                        this.Response.Redirect("Inicio.aspx");
                    }
                    else if (claveRequest.Contains("linkAtencion"))
                    {
                        this.Response.Redirect("AtencionCliente.aspx");
                    }
                    //CONTROLAR ATENCION AL CLIENTE....
                }
            }
            else
            {
                __controlFichero = new ControladorFicheros();
                string[] provincias = __controlFichero.getProvincias("/ficheros/provincias.csv");

                for (int i = 0; i < provincias.Length; i++)
                {
                    this.dropProvincias.Items.Insert(i, provincias[i]);
                }
            }
        }
        protected void btnEntrar_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {

                string email = this.inputUsuario.Text;
                string pass = this.inputPass.Text;
                controlFichero = new ControladorFicheros();
                bool exists = controlFichero.existeCliente(email, pass, ruta);

                if (exists)
                {
                    this.Response.Redirect("CompraOnline.aspx?usuario=" + email);//AUN NO HE DECIDIDO EL NOMBRE
                }
            }
            else
            {
                this.labelInfo.Visible = true;
                return;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     controlFichero = new ControladorFicheros();
     this.inputDNI.Focus();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            tree = (TreeView)this.Master.FindControl("TreeView1");
            Label lblDireccion = (Label)this.Master.FindControl("LabelDireccion");

            controlFichero = new ControladorFicheros();

            cargaControlCarrito();
            if (!this.IsPostBack)
            {
                email = this.Request.QueryString["usuario"];
                cliente = controlFichero.getCliente(email, rutaXML);
                lblDireccion.Text = "Usuario: " + cliente.Nombre + ". Direccion: " + cliente.Direccion;

                cargaTree();
                ViewState["listaproductos"] = new List<Producto>();

            }
            else if (this.IsPostBack)
            {
                //si es postback se me borra la cesta
                //la cargo SIEMPRE
                l = (List<Producto>)ViewState["listaproductos"];
                actualizaCarrito(l);
                foreach (string clave in this.Request.Params.AllKeys)
                {
                    string subseccion;
                    string claveRequest = this.Request.Params[clave];
                    switch (clave)
                    {
                        case "__EVENTTARGET":

                            if (claveRequest.Contains(tree.ID))
                            {
                                char[] separador = new char[] { '\\' };

                                try
                                {
                                    subseccion = this.Request.Params["__EVENTARGUMENT"].ToString().Split(separador)[1];
                                    Session["subActual"] = subseccion;
                                }
                                catch (IndexOutOfRangeException)
                                {

                                    return;
                                }

                                lista = controlFichero.getProductoSubseccion(subseccion, rutaSecciones);
                                rellenaTablaConProductos(lista);
                            }
                            break;

                        default:
                            break;

                    }

                    if (claveRequest.Equals("Añadir"))
                    {
                        //significa que han añadido algo
                        // tengo que tener un 'actualizaCEsta', que lea el ViewState

                        string descripcion = clave.Split(new char[] { '$' })[3];
                        string sub = (string)Session["subActual"];
                        lista = controlFichero.getProductoSubseccion(sub, rutaSecciones);
                        Producto p = (from prod in lista
                                      where prod.Descripcion == descripcion
                                      select prod).Single();

                        // almacenar en una listaViewState los objetos pulsados
                        addToViewState(p);//--> solo añado, Actualizo cuando hace postback

                        // por otro lado leer la lista para cargar el controlCesta
                        l = (List <Producto> )ViewState["listaproductos"];
                        actualizaCarrito( l );

                        rellenaTablaConProductos(lista);
                    }
                    if ( clave.Contains("BtnFormalizarPedido" ) )
                    {
                        string mail = this.Request.QueryString["usuario"];
                        cliente = controlFichero.getCliente(mail, rutaXML);
                        this.Response.Redirect("Formalizar.aspx?cliente="+cliente.Email+"&total="+this.control.Total);
                    }

                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            __controlFichero = new ControladorFicheros();
            #region "es Postback"
            if (this.IsPostBack)
            {
                foreach (string clave in this.Request.Params.Keys)
                {
                    string claveRequest = this.Request.Params[clave];
                    if (claveRequest.Contains("linkInicio"))
                    {
                        this.Response.Redirect("Inicio.aspx");
                    }
                    else if (claveRequest.Contains("linkDonde"))
                    {
                        this.Response.Redirect("DondeEstamos.aspx");
                    }
                    else if (claveRequest.Contains("linkAtencion"))
                    {
                        this.Response.Redirect("AtencionCliente.aspx");
                    }
                }
            }
            #endregion

            else if (!this.IsPostBack)
            {

                string[] localidades = __controlFichero.getLocalidades(ruta);

                for (int i = 0; i < localidades.Length; i++)
                {
                    this.dropLocalidades.Items.Insert(i, localidades[i]);
                }

                //si no hay postBack...relleno la lista
                //pero si hay postBack se pierde el contenido supongo...
                this.listaSupers = __controlFichero.getSuperFromXML(ruta);

                rellenaTablaSuper(listaSupers);
                //falta busqueda por municipios o franjas horarias.
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     miControl = new ControladorFicheros();
     this.inputNIF.Focus();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     controlFichero = new ControladorFicheros();
     string email = this.Request.QueryString["email"];
     this.inputEmail.Text = email;
 }