예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.MaintainScrollPositionOnPostBack = true;

            if (!this.IsPostBack)
            {
                List <S_Competition> competitions = CompetitionManager.GetRunningCompetitions(true);

                ListItem item = new ListItem();
                item.Value = "0";
                item.Text  = "-- Selecteer een competitie --";
                compCompetitie.Items.Add(item);

                foreach (S_Competition competition in competitions)
                {
                    S_Challenge challenge = ChallengeManager.GetChallenge(competition.challengeid);

                    item       = new ListItem();
                    item.Value = competition.id.ToString();
                    item.Text  = Conversion.DateToTitle(competition.startdate, competition.enddate) + " : " + challenge.name;
                    compCompetitie.Items.Add(item);
                }

                bool auth = Convert.ToBoolean(Session["auth"]);

                if (auth)
                {
                    long   id   = Convert.ToInt64(Session["uid"]);
                    S_User user = UserManager.GetUserById(id);
                    compFrequentBowlerNaam.Text   = user.username;
                    compFrequentBowlerNummer.Text = user.frequentbowlernumber.ToString();
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.MaintainScrollPositionOnPostBack = true;

            bool auth = Convert.ToBoolean(Session["auth"]);

            if (!auth)
            {
                _login_out = "<a class='portfolio-link' href='./Login.aspx' id='login'>Login</a>";
                _account   = "";
            }
            else
            {
                _login_out = "<a class='portfolio-link' href='./Logout.aspx' id='login'>Logout</a>";
                _account   = "<a class='portfolio-link' href='./Profile.aspx' id='profile'>Profiel</a>";
            }

            List <S_Text> texts = TextManager.GetTexts();

            foreach (S_Text st in texts)
            {
                switch (st.label)
                {
                case "Web Site Titel":
                    web_site_title.Text = st.text;
                    break;

                case "Home":
                    home.Text = st.text;
                    break;

                case "Meld je aan":
                    meldjeaan.Text = st.text;
                    break;

                case "Installeer de app":
                    installeerdeapp.Text = st.text;
                    break;

                case "Ga bowlen":
                    gabowlen.Text = st.text;
                    break;
                }
            }

            if (!this.IsPostBack)
            {
                List <S_Competition> competitions = CompetitionManager.GetRunningCompetitions(true);

                int cntr = 0;
                foreach (S_Competition competition in competitions)
                {
                    S_Challenge challenge = ChallengeManager.GetChallenge(competition.challengeid);

                    string style = "";
                    if (cntr % 2 == 0)
                    {
                        style = "class='timeline-inverted'";
                    }

                    _content += "<li " + style + " > " +
                                "<div class='timeline-image'> " +
                                "     <img class='img-circle img-responsive' src='img/competities/1.png' alt=''> " +
                                " </div> " +
                                " <div class='timeline-panel'> " +
                                "     <div class='timeline-heading'> " +
                                "         <h4>" + challenge.name + "</h4> " +
                                "         <h4 class='subheading'>" + Conversion.DateToTitle(competition.startdate, competition.enddate) + "</h4> " +
                                "     </div> " +
                                "     <div class='timeline-body'> " +
                                "         <p class='text-muted'>" + competition.description + " <a href='./Competitie.aspx' class='portfolio-link'>Doe mee!</a></p> " +
                                "     </div> " +
                                " </div> " +
                                "</li> ";

                    cntr++;
                }

                long fbn = generateFrequentBowlerNumber();
                int  cnt = 0;
                while (UserManager.UserExistByFrequentBowlerNumber(fbn) && cnt++ < 10)
                {
                    fbn = generateFrequentBowlerNumber();
                }
                meldfrequentbowlernummmer.Text = fbn.ToString();
            }
        }