コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies.Get("SAMembers");
        string     username;

        if (cookie == null)
        {
            //Response.Redirect("~/NotLoggedIn.aspx");
        }
        else
        {
            username = CheckLoggedIn.Check(cookie.Value);
        }

        List <WoWCharacter> proudmooreChars = new List <WoWCharacter>();

        proudmooreChars = (List <WoWCharacter>)Cache.Get("uploadedChars");

        if (!IsPostBack)
        {
            // to do - allow selecting of bank/no bank etc
            foreach (WoWCharacter currChar in proudmooreChars)
            {
                CbxCharacters.Items.Add(currChar.Name);
            }
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies.Get("SAMembers");
        string     username;

        if (cookie == null)
        {
            Response.Redirect("~/NotLoggedIn.aspx");
        }
        else
        {
            username = CheckLoggedIn.Check(cookie.Value);
        }

        // Retrieve the character based on the passed in char variable

        string currentChar;

        currentChar = Request.QueryString["char"];
        WoWCharacter viewChar = new WoWCharacter(currentChar);

        // Set up the detail URLs based on character name.
        Quests.NavigateUrl  = "Character.aspx?char=" + currentChar + "&detail=quests";
        Recipes.NavigateUrl = "Character.aspx?char=" + currentChar + "&detail=recipes";

        CharHeader.Text = currentChar;
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies.Get("SAMembers");
        string     username;

        if (cookie == null)
        {
            //Response.Redirect("~/NotLoggedIn.aspx");
        }
        else
        {
            username = CheckLoggedIn.Check(cookie.Value);
        }

        if (IsPostBack)
        {
            if (CharUpload.HasFile)
            {
                String InputFileName = CharUpload.FileName;
                if (InputFileName != "CharacterProfiler.lua")
                {
                    LabelStatus.Text = "Sorry, you need to upload the CharacterProfiler.lua file";
                }
                else
                {
                    HttpPostedFile InputFile = CharUpload.PostedFile;
                    Stream         theStream = InputFile.InputStream;

                    // Call the CharacterParser class to read and parse out the Proudmoore
                    // chars in the file.  Once done, save the object to the Cache.

                    CharacterParser     myChars         = new CharacterParser();
                    List <WoWCharacter> proudmooreChars = new List <WoWCharacter>();
                    proudmooreChars = myChars.DoParse(theStream);
                    Cache.Insert("uploadedChars", proudmooreChars);

                    // Count how many characters are in the file - reject if there arent any

                    int CharCount = 0;
                    foreach (WoWCharacter TempChar in proudmooreChars)
                    {
                        CharCount++;
                    }
                    if (CharCount > 0)
                    {
                        Response.Redirect("SelectChars.aspx");
                    }
                    else
                    {
                        LabelStatus.Text = "Sorry - that file doesn't have any characters from Proudmoore in it";
                    }
                }
            }
            else
            {
                LabelStatus.Text = "Sorry - you need to select a file to upload";
            }
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies.Get("SAMembers");
        string     username;

        if (cookie == null)
        {
            Response.Redirect("~/NotLoggedIn.aspx");
        }
        else
        {
            username = CheckLoggedIn.Check(cookie.Value);
        }
    }