Пример #1
0
        internal void SetSearchingMenu(LoggedUserUtility.userType user, string groupBox, string label1, string label2, string label3, string label4, string label5)
        {
            _user = user;
            this.SearchMenu.Text = groupBox;
            this.label1.Text     = label1;
            this.label2.Text     = label2;
            this.label3.Text     = label3;
            this.label4.Text     = label4;
            this.label5.Text     = label5;

            if (label1 == "")
            {
                this.label1.Visible   = false;
                this.textBox1.Visible = false;
            }
            if (label2 == "")
            {
                this.label2.Visible   = false;
                this.textBox2.Visible = false;
            }
            if (label5 == "")
            {
                this.label5.Visible   = false;
                this.textBox5.Visible = false;
            }
        }
        internal void SetProfile(LoggedUserUtility.userType user, string groupBox, string inviteMessage, string label1, string label2, string label3, string label4, string label5, string label6, string label7)
        {
            this.ProfileView.Text  = groupBox;
            this.label1.Text       = label1;
            this.label2.Text       = label2;
            this.label3.Text       = label3;
            this.label4.Text       = label4;
            this.label5.Text       = label5;
            this.label6.Text       = label6;
            this.label7.Text       = label7;
            this.InviteButton.Text = inviteMessage;

            if (inviteMessage == "Zaproś do zawodów")
            {
                if (user == LoggedUserUtility.userType.supervisor)  //tylko opiekun (user = 3) może dodać druzyne do zawodów
                {
                    InviteButton.Visible = true;
                    comboBox1.Visible    = true;
                    //znajduje zawody obecnie zalogowanego organizatora/opiekuna i wyświetlam je w comboBox1
                    var invitingUser      = LoggedUserUtility.getLoggedEmployee();
                    var usersCompetitions = LoggedUserUtility.getEmployeesCompetitions(invitingUser.id_pracownik);

                    comboBox1.ValueMember   = "id_zawody";
                    comboBox1.DisplayMember = "nazwa";
                    comboBox1.DataSource    = usersCompetitions;
                }
            }
            else
            {
                if (user == LoggedUserUtility.userType.captain)   //tylko kapitan (user = 2) może dodać zawodnika do drużyny
                {
                    InviteButton.Visible = true;
                    comboBox1.Visible    = true;

                    //znajduje drużyny obecnie zalogowanego kapitana i wyświetlam jest w comboBox1
                    var captain       = LoggedUserUtility.getLoggedContestant();
                    var captainsTeams = db.druzyna.Where(d => d.id_kapitan == captain.id_zawodnik).ToList();

                    comboBox1.ValueMember   = "id_druzyna";
                    comboBox1.DisplayMember = "nazwa";
                    comboBox1.DataSource    = captainsTeams;
                }
            }

            //MatchesView.Rows.Add("Motocross Lublin 1:0 Olsztyn");
            //MatchesView.Rows.Add("XYZ 0:1 Motocross Lublin");
        }
Пример #3
0
        internal void SetMenu(LoggedUserUtility.userType user)
        {
            _user = user;
            //jeśli użytkownik ma tylko możliwość logowania, nie może wyszukiwać
            if (_user == LoggedUserUtility.userType.lurker)
            {
                mojeKontoToolStripMenuItem.Visible = false;
                zawodyToolStripMenuItem.Visible    = false;
            }

            //organizator ma prawo do zarządzania zawodami - ustawienie przycisku jako widocznego
            if (_user == LoggedUserUtility.userType.organiser || _user == LoggedUserUtility.userType.supervisor)
            {
                zarzadzajZawodamiToolStripMenuItem.Visible = true;
                mojeKontoToolStripMenuItem.Visible         = false;
            }

            //zawodnik ma prawo do zakłądania drużyny
            if (_user == LoggedUserUtility.userType.contestant || _user == LoggedUserUtility.userType.captain)
            {
                załóżNowaDrużynęToolStripMenuItem.Visible = true;
                drużynyToolStripMenuItem.Visible          = true;
            }
        }