/// <summary> /// 向数据库中跟新数据 /// </summary> private void Updatedepart() { selecttxt = tvwDepart.SelectedNode.Text; if (DepartMgr.Update(tvwDepart.SelectedNode.Text, tvwDepart.SelectedNode.Tag.ToString())) { // untCommon.InfoMsg("修改成功。"); btnSave.Enabled = false; btnUpdate.Enabled = true; btnAdd.Enabled = true; btnAddSub.Enabled = true; tvwDepart.LabelEdit = false; btnDel.Enabled = true; } else { untCommon.InfoMsg("修改失败。"); tvwDepart.SelectedNode.Text = selecttxt; tvwDepart.SelectedNode.BeginEdit(); } }
/// <summary> /// 向数据库中跟新数据 /// </summary> private void Updatedepart() { selecttxt = tvwDepart.SelectedNode.Text; if (DepartMgr.Update(tvwDepart.SelectedNode.Text, int.Parse(tvwDepart.SelectedNode.Tag.ToString()))) { // untCommon.InfoMsg("修改成功。"); btnSave.Enabled = false; btnUpdate.Enabled = true; btnAdd.Enabled = true; tvwDepart.LabelEdit = false; btnDel.Enabled = true; this.contextMenuStrip1.Items[0].Enabled = true; this.contextMenuStrip1.Items[2].Enabled = true; } else { untCommon.InfoMsg("修改失败。"); tvwDepart.SelectedNode.Text = selecttxt; tvwDepart.SelectedNode.BeginEdit(); } }