Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();
            string id = user.ProviderUserKey.ToString();
            Guid g = Guid.Parse(id);
            bool force;
            if (XMLUploader.HasFile)
            {
                string fileExt = System.IO.Path.GetExtension(XMLUploader.FileName);
                if (fileExt == ".gpx" || fileExt == ".xml" || fileExt == ".txt")
                {
                    RoutesManager rm = new RoutesManager(g);
                    if (TextBox3.Text == "")
                    {
                        force = false;

                    }
                    else
                    {
                        force = true;
                    }
                    rm.ImportRoute(XMLUploader.FileContent, TextBox3.Text, force);

                    //rm.ImportRoute(XMLUploader.FileContent, TextBox3.Text,false);
                    // Label2.Visible = true;
                    //Label2.Text = "the task is done !";
                    TextBox3.Text = "";
                    updategrid();
                }
                else
                {
                    //Label2.Visible = true;
                    //Label2.Text = "Only .gpx files allowed!";
                }

            }
            else
            {
                //Label2.Visible = true;
                //Label2.Text = "You have not specified a file.";
            }
        }