private void buttonModify_Click(object sender, EventArgs e) { string itemName = this.textBoxItemName.Text.Trim(); if (itemName == "") { MessageBox.Show("请将工作量信息填写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (itemName == this.m_item.Item) { MessageBox.Show("你未修改任何信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } this.m_item.Item = itemName; try { string result = _sc.ModifyItem(this.m_item); if (result == Response.MODIFY_ITEM_SUCCESS.ToString()) { MessageBox.Show("修改工作量信息成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (result == "服务器连接中断") { MessageBox.Show("服务器连接中断,修改员工信息失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("修改工作量信息失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }