Пример #1
0
        private void toolStripEdit_Click(object sender, EventArgs e)
        {
            DataGridViewRow currentRow       = dataGridView1.SelectedRows[0];
            int             editID           = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
            DateTime        editDateTime     = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells[1].Value);
            float           editFuelPrice    = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[2].Value.ToString());
            float           editFuelQuantity = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[3].Value.ToString());
            float           editFuelCost     = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value.ToString());
            float           editDistance     = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[5].Value.ToString());
            EditFillUpForm  myEditFillUpForm = new EditFillUpForm(editID, editDateTime, editFuelPrice, editFuelQuantity, editFuelCost, editDistance);

            myEditFillUpForm.ShowDialog();
            FillData();
        }
Пример #2
0
 private void toolStripEdit_Click(object sender, EventArgs e)
 {
     DataGridViewRow currentRow = dataGridView1.SelectedRows[0];
     int editID = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
     DateTime editDateTime = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells[1].Value);
     float editFuelPrice = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[2].Value.ToString());
     float editFuelQuantity = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[3].Value.ToString());
     float editFuelCost = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value.ToString());
     float editDistance = (float)Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[5].Value.ToString());
     EditFillUpForm myEditFillUpForm = new EditFillUpForm(editID,editDateTime, editFuelPrice, editFuelQuantity, editFuelCost, editDistance);
     myEditFillUpForm.ShowDialog();
     FillData();
 }