Пример #1
0
        public void myInit()
        {
            // Initialize Table Adapters
            this.accountTypeTA = new AccountTypeTableAdapter();
            this.accountTA     = new AccountTableAdapter();
            this.envelopeTA    = new EnvelopeTableAdapter();
            this.lineTypeTA    = new LineTypeTableAdapter();
            this.lineItemTA    = new LineItemTableAdapter();
            this.eLineTA       = new EnvelopeLineTableAdapter();

            // Initialize Maps
            this.accountMap  = new Dictionary <string, int>();
            this.envelopeMap = new Dictionary <string, int>();

            // Fillup certain tables (Tables that can allow overlap of imported data)
            this.accountTypeTA.Fill(this.AccountType);
            this.lineTypeTA.Fill(this.LineType);

            // Setup ID Counters
            this.AccountID      = DBquery.getNewID("id", "Account");
            this.AccountTypeID  = DBquery.getNewID("id", "AccountType");
            this.EnvelopeID     = DBquery.getNewID("id", "Envelope");
            this.LineTypeID     = DBquery.getNewID("id", "LineType");
            this.LineItemID     = DBquery.getNewID("id", "LineItem");
            this.TransactionID  = DBquery.getNewID("transactionID", "LineItem");
            this.EnvelopeLineID = DBquery.getNewID("id", "EnvelopeLine");

            // Subscribe to table events
            this.Account.TableNewRow    += new System.Data.DataTableNewRowEventHandler(Account_TableNewRow);
            this.Account.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);

            this.AccountType.TableNewRow    += new System.Data.DataTableNewRowEventHandler(AccountType_TableNewRow);
            this.AccountType.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);

            this.Envelope.TableNewRow    += new System.Data.DataTableNewRowEventHandler(Envelope_TableNewRow);
            this.Envelope.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);

            this.EnvelopeLine.TableNewRow    += new System.Data.DataTableNewRowEventHandler(EnvelopeLine_TableNewRow);
            this.EnvelopeLine.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);

            this.LineItem.TableNewRow    += new System.Data.DataTableNewRowEventHandler(LineItem_TableNewRow);
            this.LineItem.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);

            this.LineType.TableNewRow    += new System.Data.DataTableNewRowEventHandler(LineType_TableNewRow);
            this.LineType.ColumnChanging += new System.Data.DataColumnChangeEventHandler(ColumnChanging);
        }
Пример #2
0
        private void LineItem_TableNewRow(object sender, System.Data.DataTableNewRowEventArgs e)
        {
            stayOut = true;
            LineItemRow newLine = e.Row as LineItemRow;

            newLine.id                 = DBquery.getNewID("id", "LineItem");
            newLine.transactionID      = DBquery.getNewID("transactionID", "LineItem");
            newLine.date               = DateTime.Today;
            newLine.typeID             = SpclLineType.NULL;
            newLine.accountID          = currentAccountID;
            newLine.oppAccountID       = SpclAccount.NULL;
            newLine.description        = "";
            newLine.confirmationNumber = "";
            newLine.envelopeID         = SpclEnvelope.NULL;
            newLine.complete           = LineState.PENDING;
            newLine.amount             = 0.00m;
            newLine.creditDebit        = LineCD.CREDIT;
            newLine.lineError          = false;
            newLine.transactionError   = false;

            stayOut = false;
        }
            ///////////////////////////////////////////////////////////////////////
            //   Function Private
            ///////////////////////////////////////////////////////////////////////


            ///////////////////////////////////////////////////////////////////////
            //   Functions Public
            ///////////////////////////////////////////////////////////////////////
            public void myFillTable()
            {
                this.LTTableAdapter.Fill(this);
                this.newID = DBquery.getNewID("id", "LineType");
            }
Пример #4
0
 /////////////////////////
 //   Functions Public
 public void myResetID()
 {
     this.newID = DBquery.getNewID("id", "Envelope");
 }
Пример #5
0
            ///////////////////////////////////////////////////////////////////////
            //   Functions Private
            ///////////////////////////////////////////////////////////////////////


            ///////////////////////////////////////////////////////////////////////
            //   Functions Public
            ///////////////////////////////////////////////////////////////////////
            public void myFillTable()
            {
                this.groupTA.Fill(this);
                this.newID = DBquery.getNewID("id", "EnvelopeGroup");
            }
Пример #6
0
 /////////////////////////
 //   Function Public
 public void myFill(int transID)
 {
     this.EnvelopeLineTA.FillByTransID(this, transID);
     this.newID = DBquery.getNewID("id", "EnvelopeLine");
 }
Пример #7
0
 /////////////////////////
 //   Public Functions
 public void myFill(int transID)
 {
     this.LineItemTA.FillByTransID(this, transID);
     this.newLineID = DBquery.getNewID("id", "LineItem");
 }
Пример #8
0
            ///////////////////////////////////////////////////////////////////////
            //   Functions Private
            ///////////////////////////////////////////////////////////////////////


            ///////////////////////////////////////////////////////////////////////
            //   Functions Public
            ///////////////////////////////////////////////////////////////////////
            public void myFillTable()
            {
                this.ACTableAdapter.Fill(this);
                this.newID = DBquery.getNewID("id", "AccountType");
            }
Пример #9
0
        public void stressFillDataBase()
        {
            stressDS = new StressDataSet();
            rnd      = new Random();

            accountTypeTA = new AccountTypeTableAdapter();
            lineTypeTA    = new LineTypeTableAdapter();
            envGroupTA    = new EnvelopeGroupTableAdapter();
            accountTA     = new AccountTableAdapter();
            envelopeTA    = new EnvelopeTableAdapter();
            lineTA        = new LineItemTableAdapter();
            envLineTA     = new EnvelopeLineTableAdapter();

            // Reset the database
            DBquery.dropTables();
            DBquery.buildTables();

            // Fill the data tables
            accountTypeTA.Fill(stressDS.AccountType);
            lineTypeTA.Fill(stressDS.LineType);
            envGroupTA.Fill(stressDS.EnvelopeGroup);
            accountTA.Fill(stressDS.Account);
            envelopeTA.Fill(stressDS.Envelope);
            lineTA.Fill(stressDS.LineItem);
            envLineTA.Fill(stressDS.EnvelopeLine);

            accountID  = DBquery.getNewID("id", "Account");
            aTypeID    = DBquery.getNewID("id", "AccountType");
            envelopeID = DBquery.getNewID("id", "Envelope");
            eGroupID   = DBquery.getNewID("id", "EnvelopeGroup");
            eLineID    = DBquery.getNewID("id", "EnvelopeLine");
            lTypeID    = DBquery.getNewID("id", "LineType");

            lineID  = DBquery.getNewID("id", "LineItem");
            transID = DBquery.getNewID("transactionID", "LineItem");
            date    = DateTime.Now.AddMonths(-12 * 100).Date;

            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();
            addAccount();

            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();
            addEnvelope();

            int num;

            // Make alot of entries
            while (date < DateTime.Now.AddMonths(3).Date)
            {
                num = rnd.Next(0, 10000);

                if (num == 0)
                {
                    addAccountType();
                }
                else if (num == 1)
                {
                    addLineType();
                }
                else if (num == 2)
                {
                    addEnvelopeGroup();
                }

                if (10 < num && num < 15)
                {
                    addAccount();
                }

                if (30 < num && num < 34)
                {
                    addEnvelope();
                }


                if (100 < num && num < 200)
                {
                    complexTrans();
                }
                else
                {
                    simpleTrans();
                }
            }

            // Save the data
            accountTypeTA.Update(stressDS.AccountType);
            lineTypeTA.Update(stressDS.LineType);
            envGroupTA.Update(stressDS.EnvelopeGroup);
            accountTA.Update(stressDS.Account);
            envelopeTA.Update(stressDS.Envelope);
            lineTA.Update(stressDS.LineItem);
            envLineTA.Update(stressDS.EnvelopeLine);
        }
Пример #10
0
 /////////////////////////
 //   Functions Public
 public void myResetID()
 {
     this.newID = DBquery.getNewID("id", "Account");
 }