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); }