/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModify_Click(object sender, EventArgs e) { DataGridViewRow currentRow = this.dgvTimeControlLine.CurrentRow; if (currentRow == null) { NUnit.UiKit.UserMessage.DisplayInfo(XD100Strings.FirstSelectItem); return; } int index = currentRow.Index; if (currentRow.DataBoundItem != null) { KeyValuePair <int, int> bindKv = (KeyValuePair <int, int>)currentRow.DataBoundItem; int ot = Convert.ToInt32(currentRow.Cells[0].Value); int gt2 = Convert.ToInt32(currentRow.Cells[1].Value); int otPrevious = GetOTPrevious(index); int otNext = GetOTNext(index); //frmTimeValue f = new frmTimeValue(time, value, this.GTBase2); frmOTGT2Value f = new frmOTGT2Value(ot, gt2, otPrevious, otNext); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { //currentRow.Cells[0].Value = f.Time; //currentRow.Cells[1].Value = f.Adjust; KeyValuePair <int, int> kv = new KeyValuePair <int, int>(f.OT, f.GT2); this.OTControlLine[index] = kv; this.dgvTimeControlLine.Refresh(); this.BindZed(); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModify_Click(object sender, EventArgs e) { DataGridViewRow currentRow = this.dgvTimeControlLine.CurrentRow; if (currentRow == null) { NUnit.UiKit.UserMessage.DisplayInfo(XD100Strings.FirstSelectItem); return; } int index = currentRow.Index; if (currentRow.DataBoundItem != null) { KeyValuePair<int, int> bindKv = (KeyValuePair<int, int>)currentRow.DataBoundItem; int ot = Convert.ToInt32(currentRow.Cells[0].Value); int gt2 = Convert.ToInt32(currentRow.Cells[1].Value); int otPrevious = GetOTPrevious(index); int otNext = GetOTNext(index); //frmTimeValue f = new frmTimeValue(time, value, this.GTBase2); frmOTGT2Value f = new frmOTGT2Value(ot, gt2, otPrevious, otNext); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { //currentRow.Cells[0].Value = f.Time; //currentRow.Cells[1].Value = f.Adjust; KeyValuePair<int, int> kv = new KeyValuePair<int, int>(f.OT, f.GT2); this.OTControlLine[index] = kv; this.dgvTimeControlLine.Refresh(); this.BindZed(); } } }