Beispiel #1
0
        void Dc_ScanEnded1(object sender, ScanEndedEventArgs e)
        {
            if (e.TableName == "prod")
            {
                int av   = e.DataManager.GetInt32("available");
                int unav = e.DataManager.GetInt32("unavailable");

                e.DataManager.AddInt32("total", av + unav);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Performs some operations after the SCAN loop is finished.
 /// In this case, we pick the value of the "subtotal" variable and use it to calculate
 /// the (final) total and taxes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Dc_ScanEnded(object sender, ScanEndedEventArgs e)
 {
     //Make sure the loop corresponds to the "Invoice Lines" table.
     //NTemplates raises an event for each scan loop and we need to be sure we're working
     //with the right one.
     if (e.TableName == "L")
     {
         double subTotal = e.DataManager.GetDouble(_subtotal);
         double taxes    = subTotal * 22 / 100; //22% taxes
         double total    = subTotal + taxes;
         e.DataManager.AddDouble(_taxes, taxes);
         e.DataManager.AddDouble(_total, total);
     }
 }
Beispiel #3
0
 internal void RaiseScanEndedEvent(ScanEndedEventArgs e)
 {
     ScanEnded?.Invoke(this, e);
 }
Beispiel #4
0
 internal void RaiseScanEndedEvent(ScanEndedEventArgs e)
 {
     Creator.RaiseScanEndedEvent(e);
 }