private void btnSave_Click(object sender, EventArgs e) { string _text = ""; if (_SelectedItem == null) { _text = tbGroupName.Text; } else { _text = (_SelectedItem as ClassLibrary.JKeyValue).Value.ToString(); } if (_text.Length > 0) { JGroupName.DeleteByGroupName(ClassLibrary.JMainFrame.CurrentPostCode, _text); foreach (object d in chkUsers.CheckedItems) { int PostCodeGuest = ((int)(d as ClassLibrary.JKeyValue).Value); JGroupName G = new JGroupName(); G.GroupName = _text; G.PostCode = ClassLibrary.JMainFrame.CurrentPostCode; G.PostCodeGuest = PostCodeGuest; G.Insert(); } _SetForm(); _SelectedItem = null; } }
private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (lbGroup.SelectedItem != null) { JGroupName.DeleteByGroupName(ClassLibrary.JMainFrame.CurrentPostCode, (lbGroup.SelectedItem as ClassLibrary.JKeyValue).Value.ToString()); _SetForm(); } }