private void btnEdit_Click(object sender, System.EventArgs e) { int row = dataGridXGTasK.CurrentRowIndex; if (row == -1) { return; } int id = int.Parse(dataGridXGTasK[row, 0].ToString()); string stName = dataGridXGTasK[row, 1].ToString(); string person = dataGridXGTasK[row, 2].ToString(); string cardsn = dataGridXGTasK[row, 3].ToString(); string beginTs = dataGridXGTasK[row, 4].ToString(); string endTs = dataGridXGTasK[row, 5].ToString(); //XGTime time = new XGTime( DateTime.Parse ( DateTime.Now.Date.ToString() + " " + beginTs ), // DateTime.Parse ( DateTime.Now.Date.ToString() + " " + endTs ) ); XGTime time = new XGTime(DateTime.Parse(beginTs), DateTime.Parse(endTs)); frmXGTaskItem f = new frmXGTaskItem(); f.AdeState = ADEState.Edit; f.EditId = id; f.XgStationName = stName; f.Person = person; f.CardSN = cardsn; f.XGTime = time; if (f.ShowDialog(this) == DialogResult.OK) { XGDB.UpdateXGTask(id, f.XgStationName, f.Person, f.XGTime); LoadXGTaskFromDB(); // 2007.01.30 Added // XGDB.Resolve(); } }