private void ИзменитьToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 1) { ListViewItem item = listView1.SelectedItems[0]; UpdateConstructor ic = new UpdateConstructor(); ic.Wheres = "`name`='" + item.SubItems[0].Text + "'"; Priorities_Add pa = new Priorities_Add(pri.ToArray()); pa.SetValues(item.SubItems[0].Text, item.SubItems[1].Text, item.SubItems[2].Text); pa.CheckExistsKey = false; if (pa.ShowForm()) { ic.Values.Add(new DBKV("name", pa.PrName.ToString())); ic.Values.Add(new DBKV("label", pa.PrLabel)); ic.Values.Add(new DBKV("color", ColorTranslator.ToHtml(pa.PrColor))); item.SubItems[0].Text = pa.PrName.ToString(); item.SubItems[1].Text = pa.PrLabel; item.SubItems[2].Text = ColorTranslator.ToHtml(pa.PrColor); UpdatePriorities = true; } dbm.EditPriority(ic); sync_manager.Synchronization.Changes += 1; pa.Dispose(); pa = null; } }
private void СоздатьНовыйToolStripMenuItem_Click(object sender, EventArgs e) { Priorities_Add pa = new Priorities_Add(pri.ToArray()); if (pa.ShowForm()) { Priority pr = new Priority(pa.PrName, pa.PrLabel, pa.PrColor); pri.Add(pr); Print(); dbm.AddPriority(pr); UpdatePriorities = true; sync_manager.Synchronization.Changes += 1; } pa.Dispose(); pa = null; }