Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Transaction trans = new Transaction();
            int currentTransCount = this.transPrivateCopy.Transactions.Count;

            if (currentTransCount == 0)
            {
                trans.TransStep = 1;
                trans.TransTableName = "TransTableName1";
            }
            else
            {
                trans.TransStep = this.transPrivateCopy.Transactions[currentTransCount - 1].TransStep + 1;
                trans.TransTableName = "TransTableName" + trans.TransStep;
            }
            this.transPrivateCopy.Transactions.Add(trans);

            TablePanel tp = new TablePanel(trans, this.DesignerHost,this);
            tp.Location = new Point(this.srcTablePanel.Location.X + this.srcTablePanel.Width + 100 - 5 * currentTransCount,
                this.srcTablePanel.Location.Y + currentTransCount * (30 + 10 + 60));

            // Event to Select or Move TransTable
            tp.MouseMove += new MouseEventHandler(tp_MouseMove);
            tp.MouseDown += new MouseEventHandler(tp_MouseDown);
            tp.MouseUp += new MouseEventHandler(tp_MouseUp);

            this.pnlTableView.Controls.Add(tp);
            this.TransTablePanels.Add(tp);

            this.srcTablePanel.ResizePanel();
            this.pnlTableView.Refresh();
        }
Ejemplo n.º 2
0
        private void SetUpUI()
        {
            // Set up Timing Selection
            //
            // SetTimingSelection();

            // Get SrcTableName
            //
            if (transPrivateCopy.UpdateComponent != null
             && transPrivateCopy.UpdateComponent.Command != null)
            {
                this.SrcTableName = transPrivateCopy.UpdateComponent.Command.EntitySetName;
            }
            else
            {
                this.SrcTableName = "";
            }

            // Set Transactions view
            //
            this.pnlTableView.Controls.Clear();

            this.srcTablePanel = new SrcTablePanel(this.transPrivateCopy, this.SrcTableName, this);
            srcTablePanel.Location = new Point(30, 10);
            // Event to move scrTablePanel
            this.srcTablePanel.MouseMove += new MouseEventHandler(scrTablePanel_MouseMove);
            this.srcTablePanel.MouseDown += new MouseEventHandler(scrTablePanel_MouseDown);
            this.srcTablePanel.MouseUp += new MouseEventHandler(scrTablePanel_MouseUp);
            this.pnlTableView.Controls.Add(srcTablePanel);
            this.srcTablePanel.ResizePanel();

            this.TransTablePanels = new ArrayList();

            for (int i = 0; i < this.transPrivateCopy.Transactions.Count; ++i)
            {
                TablePanel tp = new TablePanel(this.transPrivateCopy.Transactions[i], this.DesignerHost, this);

                tp.Location = new Point(this.srcTablePanel.Location.X + this.srcTablePanel.Width + 100 - i * 5,
                 this.srcTablePanel.Location.Y + i * (30 + 10 + 60));

                // Event to Select or Move TransTable
                tp.MouseMove += new MouseEventHandler(tp_MouseMove);
                tp.MouseDown += new MouseEventHandler(tp_MouseDown);
                tp.MouseUp += new MouseEventHandler(tp_MouseUp);

                this.pnlTableView.Controls.Add(tp);
                this.TransTablePanels.Add(tp);
            }
        }