コード例 #1
0
        //edit a runners data
        private void RunnerTableDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var      row       = dataGridRunners.Rows[e.RowIndex];
            string   info      = "";
            string   firstName = "";
            string   lastName  = "";
            DateTime dob       = DateTime.MinValue;
            string   bibId     = "";
            string   team      = "";
            string   org       = "";
            char     sex       = 'N';

            foreach (DataGridViewTextBoxCell data in row.Cells)
            {
                switch (dataGridRunners.Columns[data.ColumnIndex].Name)
                {
                case "FirstName":
                    firstName = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                    break;

                case "LastName":
                    lastName = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                    break;

                case "BibID":
                    bibId = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                    break;

                case "DOB":
                    var parts = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString().Split('-');
                    dob = new DateTime(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2]));
                    break;

                case "Team":
                    team = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                    break;

                case "Orginization":
                    org = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                    break;

                case "Gender":
                    sex = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString().ToUpper().ToCharArray()[0];
                    break;

                default:
                    break;
                }
            }
            var person = new NewUserWindow(raceData, this, firstName, lastName, dob, bibId, sex, team, org);

            person.Show();
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: austin-may/TimingByToby
 //edit a runners data
 private void RunnerTableDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     var row=dataGridRunners.Rows[e.RowIndex];
     string info = "";
     string firstName = "";
     string lastName = "";
     DateTime dob = DateTime.MinValue;
     string bibId = "";
     string team = "";
     string org = "";
     char sex='N';
     foreach (DataGridViewTextBoxCell data in row.Cells)
     {
         switch (dataGridRunners.Columns[data.ColumnIndex].Name)
         {
             case "FirstName":
                 firstName = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                 break;
             case "LastName":
                 lastName = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                 break;
             case "BibID":
                 bibId = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                 break;
             case "DOB":
                 var parts = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString().Split('-');
                 dob = new DateTime(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2]));
                 break;
             case "Team":
                 team = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                 break;
             case "Orginization":
                 org = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString();
                 break;
             case "Gender":
                 sex = dataGridRunners[data.ColumnIndex, data.RowIndex].Value.ToString().ToUpper().ToCharArray()[0];
                 break;
             default:
                 break;
         }
     }
     var person = new NewUserWindow(raceData, this, firstName, lastName, dob, bibId, sex, team, org);
     person.Show();
 }
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: austin-may/TimingByToby
 //adding user button
 private void BtnAddRunner_Click(object sender, EventArgs e)
 {
     var user = new NewUserWindow(raceData, this);
     user.Show();
 }
コード例 #4
0
        //adding user button
        private void BtnAddRunner_Click(object sender, EventArgs e)
        {
            var user = new NewUserWindow(raceData, this);

            user.Show();
        }