コード例 #1
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // Create a vendor
            VENDOR ven = new VENDOR();

            if (this.varVendor == "")
            {
                ven.name = "Vend" + StringFunctions.RandStr("X(8)");
                PayablesLedger._SA_Create(ven);
                PayablesLedger._SA_Close();
            }
            else
            {
                ven.name = this.varVendor;
            }



            // Create an item
            ITEM item = new ITEM();

            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();

            if (this.varItem == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");
                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this.varItem;
            }


            // Create an Invoice
            PURCHASE_INVOICE pi = new PURCHASE_INVOICE();

            pi.Vendor = ven;



            ROW r = new ROW();

            r.Item = item;
            r.Item.invOrServNumber = item.invOrServNumber;
            r.quantityReceived     = Functions.RandCashAmount(2);
            // need a pause to create a different random number..
            System.Threading.Thread.Sleep(1000);
            r.price = Functions.RandCashAmount();

            pi.GridRows.Add(r);

            if (this.varPInvoice == "")
            {
                pi.transNumber = StringFunctions.RandStr("9(8)");

                PurchasesJournal._SA_Create(pi);
                System.Threading.Thread.Sleep(2000);
                PurchasesJournal._SA_Close();
            }
            else
            {
                pi.transNumber = this.varPInvoice;
            }

            // Create a payment
            PAYMENT_PURCH payment = new PAYMENT_PURCH();

            payment.Vendor = ven;
            PAY_ROW row1 = new PAY_ROW();

            row1.Invoice = pi;
            payment.GridRows.Add(row1);

            PaymentsJournal._SA_CreatePayment(payment);
            System.Threading.Thread.Sleep(1000);
            PaymentsJournal._SA_Close();
        }