public ChoiceEditPanel(MainForm owner, TrackerContext context)
            : base("choice", context, owner)
        {
            this.RootPanel = new TableLayoutPanel()
            {
                Dock = DockStyle.Fill,
                RowCount = 2,
                ColumnCount = 1,
                RowStyles =
                {
                    new RowStyle(SizeType.Percent, 60.0f),
                    new RowStyle(SizeType.Percent, 40.0f),
                },
                ColumnStyles =
                {
                    new ColumnStyle(SizeType.Percent, 100.0f),
                },
            };

            this.ChoiceForm = new EntityFormPanelConstruct("choice",
                new string[]
                {
                    "total",
                    "name",
                    "description",
                    "state",
                    "speedrun",
                },
                this.Context,
                this.Owner
            )
            {
                Dock = DockStyle.Fill,
            };

            this.OptionsTable = new EntityTablePanelConstruct("choiceoption",
                this.Owner, this.Context,
                new string[]
                {
                    "name",
                    "total",
                }
            )
            {
                Dock = DockStyle.Fill,
            };

            this.RootPanel.Controls.Add(this.ChoiceForm, 0, 0);
            this.RootPanel.Controls.Add(this.OptionsTable, 0, 1);
            this.Controls.Add(this.RootPanel);
        }
        public DonationEditPanel(MainForm owner, TrackerContext context)
            : base("donation", context, owner)
        {
            this.RootPanel = new TableLayoutPanel()
            {
                Dock = DockStyle.Fill,
                ColumnCount = 1,
                RowCount = 2,
                ColumnStyles =
                {
                    new ColumnStyle(SizeType.Percent, 100.0f),
                },
                RowStyles =
                {
                    new RowStyle(SizeType.Percent, 75.0f),
                    new RowStyle(SizeType.Percent, 25.0f),
                },
            };

            this.FormPanel = new EntityFormPanelConstruct("donation",
                new string[]
                {
                    //"domain",
                    //"domainId",
                    "timereceived",
                    "amount",
                    "donor",
                    "comment",
                    "modcomment",
                    "readstate",
                    "commentstate",
                    "bidstate",
                },
                this.Context,
                this.Owner
            )
            {
                Dock = DockStyle.Fill,
            };

            this.BidsPanel = new EntityTablePanelConstruct("donationbid", this.Owner, this.Context,
                new string[]
                {
                    "amount",
                    "target",
                }
            )
            {
                Dock = DockStyle.Fill,
                AddAllowed = true,
            };

            this.BidsPanel.Binding.AddModelMapping("choicebid",
                new Dictionary<string, string>()
                {
                    { "amount", "amount" },
                    { "option", "target" },
                });

            this.BidsPanel.Binding.AddModelMapping("challengebid",
                new Dictionary<string, string>()
                {
                    { "amount", "amount" },
                    { "challenge", "target" },
                });

            this.RootPanel.Controls.Add(this.FormPanel, 0, 0);
            this.RootPanel.Controls.Add(this.BidsPanel, 0, 1);
            this.Controls.Add(this.RootPanel);
        }
        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;
        }
        public DonorEditPanel(MainForm owner, TrackerContext context)
            : base("donor", context, owner)
        {
            this.RootPanel = new TableLayoutPanel()
            {
                Dock = DockStyle.Fill,
                ColumnCount = 1,
                RowCount = 3,
                RowStyles =
                {
                    new RowStyle(SizeType.AutoSize),
                    new RowStyle(SizeType.Percent, 66.0f),
                    new RowStyle(SizeType.Percent, 34.0f),
                }
            };

            this.DonorForm = new EntityFormPanelConstruct("donor",
                new string[]
                {
                    "firstname",
                    "lastname",
                    "alias",
                    "email",
                    "anonymous",
                }, this.Context, this.Owner
            )
            {
                Dock = DockStyle.Fill,
            };

            this.DonationTable = new EntityTablePanelConstruct("donation",
                this.Owner,
                this.Context,
                new string[]
                {
                    "domain",
                    "amount",
                    "comment",
                    "modcomment",
                    "timereceived",
                }
            )
            {
                Dock = DockStyle.Fill,
                AddAllowed = false, // maybe true...
            };

            this.PrizeTable = new EntityTablePanelConstruct("prize",
                this.Owner,
                this.Context,
                new string[]
                {
                    "name",
                    "provided",
                    "description",
                }
            )
            {
                Dock = DockStyle.Fill,
                AddAllowed = false,
            };

            this.PrizeTable.Binding.Context = this.Context;

            this.RootPanel.Controls.Add(this.DonorForm, 0, 0);
            this.RootPanel.Controls.Add(this.DonationTable, 0, 1);
            this.RootPanel.Controls.Add(this.PrizeTable, 0, 2);

            this.Controls.Add(this.RootPanel);
        }