public EntityTab(MainForm owner, TrackerContext context, string rootModel) { InitializeComponent(); this.Owner = owner; this.Access = new EntityAccessContext(rootModel, context); this.Access.RefreshComplete += this.OnRefreshComplete; this.Access.SaveComplete += this.OnSaveComplete; this.Access.DeleteComplete += this.OnDeleteComplete; this.Access.Error += this.OnError; }
public void Initialize(MainForm owner, TrackerContext context) { this.Owner = owner; this.Context = context; this.BidsTable = new EntityTablePanelConstruct("donationbid", this.Owner, this.Context, new string[] { "amount", "target", } ) { Dock = DockStyle.Fill, AddAllowed = true, TabIndex = 11, }; this.BidsTable.Binding.AddModelMapping("choicebid", new Dictionary<string, string>() { { "amount", "amount" }, { "option", "target" }, }); this.BidsTable.Binding.AddModelMapping("challengebid", new Dictionary<string, string>() { { "amount", "amount" }, { "challenge", "target" }, }); this.DonationPanel.Controls.Add(this.BidsTable, 0, 7); this.DonationPanel.SetColumnSpan(this.BidsTable, 2); this.BidsTable.Enabled = false; this.Combiner = new EntityAccessContext("donation", this.Context); this.Combiner.AddForm(this.DonationBinding); this.Combiner.AddTable(this.BidsTable.Binding, DonationModels.DonationModel.GetField("bids") as EntitySetModel); this.Combiner.SaveComplete += this.OnSaveComplete; this.Combiner.Error += this.OnSaveError; }