private void btnUpater_Click(object sender, EventArgs e) { if (lvCust.SelectedItems.Count <= 0) { return; } List <string> listStr = new List <string>(); for (int i = 0; i < lvCust.SelectedItems[0].SubItems.Count; i++) { listStr.Add(lvCust.SelectedItems[0].SubItems[i].Text); } AddCust ac = new AddCust(1); ac.acceptList(listStr); ac.ShowDialog(); }
//修改个人资料 private void tsmiUpdate_Click(object sender, EventArgs e) { List <string> listStr = new List <string>(); DBHelper db = null; db = new DBHelper(); string sql = string.Format("select * from Users where U_UsersId='{0}'", Users); SqlDataReader sdr = db.SelectAll(sql); if (sdr.Read()) { for (int i = 0; i < 10; i++) { listStr.Add(sdr[i].ToString()); } } AddCust ac = new AddCust(1); ac.acceptList(listStr); ac.ShowDialog(); }