private void EditHistoryButton_Click(object sender, EventArgs e)
 {
     int index = historiesList.SelectedIndex;
     if (index != -1 && historiesList.SelectedIndices.Count == 1)
     {
         var history = Histories[index];
         var editForm = new EditHistoryForm(history, isAutoWeld);
         var result = editForm.ShowDialog(this);
         if (result == DialogResult.OK)
         {
             ShowHistory();
         }
     }
     else
     {
         MessageBox.Show(this, "请选择一条焊接记录。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        private void EditHistoryButton_Click(object sender, EventArgs e)
        {
            int index = historiesList.SelectedIndex;

            if (index != -1 && historiesList.SelectedIndices.Count == 1)
            {
                var history  = Histories[index];
                var editForm = new EditHistoryForm(history, isAutoWeld);
                var result   = editForm.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    ShowHistory();
                }
            }
            else
            {
                MessageBox.Show(this, "请选择一条焊接记录。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }