private ListViewItem AddItem(Profiles.OrderRelationElement element) { ListViewItem lvi = listView.Items.Add(element.GetAttribute("ID")); lvi.Tag = (object)element; lvi.SubItems.Add(element.GetAttribute("Code")); lvi.SubItems.Add(element.GetAttribute("Name")); return(lvi); }
protected void AddElement(Profiles.OrderRelationElement element, PropertyBag bag) { const string category = "Provision¶©¹º"; string desc = String.Format("ID := {{{0}}}", element.GetAttribute("Code")); PropertySpec item = new PropertySpec(element.GetAttribute("Name"), 0, category, desc); item.Key = element.GetAttribute("Code"); #if false item.Attributes = new Attribute[] { ReadOnlyAttribute.Yes }; #endif bag.Add(item); }
private void btnRemove_Click(object sender, EventArgs e) { Debug.Assert(this.Profile != null); if (listView.SelectedItems.Count == 0) { return; } ListViewItem lvi = listView.SelectedItems[0]; Profiles.OrderRelationElement element = (Profiles.OrderRelationElement)lvi.Tag; this.Profile.RemoveChild(element); listView.SelectedItems[0].Remove(); }
private void btnAdd_Click(object sender, EventArgs e) { Debug.Assert(this.Profile != null); Profiles.OrderRelationElement element = this.Profile.CreateElement(Profiles.OrderRelationType); element.SetAttribute("ID", lstIndex.Text); element.SetAttribute("Code", txtCode.Text); element.SetAttribute("FeeUser", lstFeeUser.SelectedIndex.ToString()); element.SetAttribute("FeeType", lstFeeType.SelectedIndex.ToString()); element.SetAttribute("FeeCode", txtFeeCode.Text); element.SetAttribute("Name", txtName.Text); AddItem(element); }
private void listView_SelectedIndexChanged(object sender, EventArgs e) { if (listView.SelectedItems.Count == 0) { return; } ListViewItem lvi = listView.SelectedItems[0]; Profiles.OrderRelationElement element = (Profiles.OrderRelationElement)lvi.Tag; this.lstIndex.Text = element.GetAttribute("ID"); this.txtCode.Text = element.GetAttribute("Code"); this.lstFeeUser.SelectedIndex = int.Parse(element.GetAttribute("FeeUser")); this.lstFeeType.SelectedIndex = int.Parse(element.GetAttribute("FeeType")); this.txtFeeCode.Text = element.GetAttribute("FeeCode"); this.txtName.Text = element.GetAttribute("Name"); btnRemove.Enabled = true; }
public frmProfilesMobile(Profiles.OrderRelationElement profile) { this.Profile = profile; InitializeComponent(); }