Exemple #1
0
        private void addEnvLines(ref StressDataSet.LineItemRow line)
        {
            if (false == line.AccountRowByFK_Line_accountID.envelopes)
            {
                line.envelopeID = SpclEnvelope.NULL;
                return;
            }
            else
            {
                StressDataSet.EnvelopeLineRow eRow = null;
                decimal sum = 0.0m;
                int     num = rnd.Next(1, 5);

                for (int i = 0; i < num; i++)
                {
                    eLineID++;

                    eRow             = stressDS.EnvelopeLine.NewEnvelopeLineRow();
                    eRow.id          = eLineID;
                    eRow.lineItemID  = line.id;
                    eRow.envelopeID  = rnd.Next(0, envelopeID);
                    eRow.description = "";

                    if (i + 1 == num)
                    {
                        eRow.amount = line.amount - sum;
                    }
                    else
                    {
                        eRow.amount = rnd.Next(-10000, 100000) / 100.0m;
                        sum        += eRow.amount;
                    }

                    this.stressDS.EnvelopeLine.AddEnvelopeLineRow(eRow);
                }

                if (num == 1)
                {
                    line.envelopeID = eRow.envelopeID;
                }
                else
                {
                    line.envelopeID = SpclEnvelope.SPLIT;
                }
            }
        }
Exemple #2
0
        private void simpleTrans()
        {
            StressDataSet.LineItemRow lineRowC = stressDS.LineItem.NewLineItemRow();
            StressDataSet.LineItemRow lineRowD = stressDS.LineItem.NewLineItemRow();

            decimal amount = rnd.Next(1, 100000) / 100.0m;

            if (rnd.Next(0, 5) == 0)
            {
                date = date.AddDays(-3);
            }
            else
            {
                date = date.AddDays(1);
            }

            lineRowC.id                 = lineID;
            lineRowD.id                 = lineID + 1;
            lineRowC.transactionID      = transID;
            lineRowD.transactionID      = transID;
            lineRowC.date               = date;
            lineRowD.date               = date;
            lineRowC.amount             = amount;
            lineRowD.amount             = amount;
            lineRowC.description        = "";
            lineRowD.description        = "";
            lineRowC.confirmationNumber = "";
            lineRowD.confirmationNumber = "";
            lineRowC.complete           = LineState.CLEARED;
            lineRowD.complete           = LineState.CLEARED;
            lineRowC.creditDebit        = LineCD.DEBIT;
            lineRowD.creditDebit        = LineCD.CREDIT;
            lineRowC.typeID             = rnd.Next(1, lTypeID);
            lineRowD.typeID             = rnd.Next(1, lTypeID);
            lineRowC.accountID          = lineRowD.oppAccountID = rnd.Next(1, accountID);
            lineRowD.accountID          = lineRowC.oppAccountID = rnd.Next(1, accountID);

            this.addEnvLines(ref lineRowC);
            this.addEnvLines(ref lineRowD);

            this.stressDS.LineItem.AddLineItemRow(lineRowC);
            this.stressDS.LineItem.AddLineItemRow(lineRowD);

            transID++;
            lineID += 2;
        }