예제 #1
0
 private void book_button_Click(object sender, EventArgs e)
 {
     var bf = new BookingForm();
     bf.Date = monthCalendar.SelectionStart;
     bf.Time = (String)dataGridView["tid", dataGridView.CurrentRow.Index].Value;
     var data = dataGridView["spelare_1", dataGridView.CurrentRow.Index].Value;
     if (!System.DBNull.Value.Equals(data))
     {
         bf.Player_1 = (String)data;
     }
     data = dataGridView["spelare_2", dataGridView.CurrentRow.Index].Value;
     if (!System.DBNull.Value.Equals(data))
     {
         bf.Player_2 = (String)data;
     }
     data = dataGridView["spelare_3", dataGridView.CurrentRow.Index].Value;
     if (!System.DBNull.Value.Equals(data))
     {
         bf.Player_3 = (String)data;
     }
     data = dataGridView["spelare_4", dataGridView.CurrentRow.Index].Value;
     if (!System.DBNull.Value.Equals(data))
     {
         bf.Player_4 = (String)data;
     }
     bf.ShowDialog();
     UpdateTable();
 }
예제 #2
0
        private void book_button_Click(object sender, EventArgs e)
        {
            var bf = new BookingForm();

            bf.Date = monthCalendar.SelectionStart;
            bf.Time = (String)dataGridView["tid", dataGridView.CurrentRow.Index].Value;
            var data = dataGridView["spelare_1", dataGridView.CurrentRow.Index].Value;

            if (!System.DBNull.Value.Equals(data))
            {
                bf.Player_1 = (String)data;
            }
            data = dataGridView["spelare_2", dataGridView.CurrentRow.Index].Value;
            if (!System.DBNull.Value.Equals(data))
            {
                bf.Player_2 = (String)data;
            }
            data = dataGridView["spelare_3", dataGridView.CurrentRow.Index].Value;
            if (!System.DBNull.Value.Equals(data))
            {
                bf.Player_3 = (String)data;
            }
            data = dataGridView["spelare_4", dataGridView.CurrentRow.Index].Value;
            if (!System.DBNull.Value.Equals(data))
            {
                bf.Player_4 = (String)data;
            }
            bf.ShowDialog();
            UpdateTable();
        }