コード例 #1
0
ファイル: CUsers.cs プロジェクト: AnotherByte/Jeopardy
        // get users from database and fill list
        public void FillUsers()
        {
            DataTable dtUsers = DBAccess.GetUsers();

            foreach (DataRow dr in dtUsers.Rows)
            {
                cUser oUser = new cUser();
                oUser.Load(dr);
                this.Add(oUser);
            }
        }
コード例 #2
0
ファイル: CUsers.cs プロジェクト: AnotherByte/Jeopardy
 // get user from user_id (null if not found)
 public cUser Item(int vsCatID)
 {
     tempUser = null;
     foreach (cUser oUser in mcol)
     {
         if (oUser.ID == vsCatID)
         {
             tempUser = oUser;
         }
     }
     return tempUser;
 }
コード例 #3
0
ファイル: CUsers.cs プロジェクト: AnotherByte/Jeopardy
 // add given cUser to list
 private void Add(cUser newUser)
 {
     mcol.Add(newUser);
 }
コード例 #4
0
ファイル: CUsers.cs プロジェクト: AnotherByte/Jeopardy
 // constructor
 public cUsers()
 {
     mcol = new List<cUser>();
     tempUser = new cUser();
 }
コード例 #5
0
        public frmJeopardyBoard(cUser oUser)
        {
            InitializeComponent();

            oCurrentUser = oUser;
            Random rand = new Random();
            sDailyDouble = char.ConvertFromUtf32(rand.Next(65, 70)) + rand.Next(1,6).ToString();

            #region button array

            // create array for buttons
            arButtons = new Button[6, 5];

            // fill array
            arButtons[0, 0] = btnA1;
            arButtons[0, 1] = btnA2;
            arButtons[0, 2] = btnA3;
            arButtons[0, 3] = btnA4;
            arButtons[0, 4] = btnA5;

            arButtons[1, 0] = btnB1;
            arButtons[1, 1] = btnB2;
            arButtons[1, 2] = btnB3;
            arButtons[1, 3] = btnB4;
            arButtons[1, 4] = btnB5;

            arButtons[2, 0] = btnC1;
            arButtons[2, 1] = btnC2;
            arButtons[2, 2] = btnC3;
            arButtons[2, 3] = btnC4;
            arButtons[2, 4] = btnC5;

            arButtons[3, 0] = btnD1;
            arButtons[3, 1] = btnD2;
            arButtons[3, 2] = btnD3;
            arButtons[3, 3] = btnD4;
            arButtons[3, 4] = btnD5;

            arButtons[4, 0] = btnE1;
            arButtons[4, 1] = btnE2;
            arButtons[4, 2] = btnE3;
            arButtons[4, 3] = btnE4;
            arButtons[4, 4] = btnE5;

            arButtons[5, 0] = btnF1;
            arButtons[5, 1] = btnF2;
            arButtons[5, 2] = btnF3;
            arButtons[5, 3] = btnF4;
            arButtons[5, 4] = btnF5;

            // label buttons
            for (int x = 0; x < 6; x++)
            {
                for (int y = 0; y < 5; y++)
                {
                    arButtons[x,y].Text = string.Format("${0}", ((y+1)*200));
                }
            }

            #endregion

            // display daily double
            int iQuestNum, iCatNum;
            iCatNum = char.ConvertToUtf32(sDailyDouble, 0) - 65;
            int.TryParse(sDailyDouble[1].ToString(), out iQuestNum);
            iQuestNum--;
            arButtons[iCatNum, iQuestNum].Text = string.Format("{0}, {1}{2}", sDailyDouble, iCatNum, iQuestNum);
        }