private void Dc_AfterScanRecord1(object sender, AfterScanRecordEventArgs e)
        {
            if (e.TableName == "P")
            {
                //Count available and unavailable products (Totals)
                int available   = e.DataManager.GetInt32("available");
                int unavailable = e.DataManager.GetInt32("unavailable");
                if (e.Record[3].ToString() == "Yes")
                {
                    available++;
                }
                else
                {
                    unavailable++;
                }
                e.DataManager.AddInt32("available", available);
                e.DataManager.AddInt32("unavailable", unavailable);

                if (e.DataManager.GetBoolean("groupEnd"))
                {
                    e.DataManager.AddInt32("avail", 0);
                    e.DataManager.AddInt32("unavail", 0);
                    e.DataManager.AddInt32("tot", 0);
                }
            }
        }
Beispiel #2
0
        public void Expand()
        {
            int pos = 0;

            DocumentParser.RaiseScanStartEvent(new ScanStartEventArgs(tableName, DocumentParser.DataManager));
            foreach (DataRow row in this.Table.Rows)
            {
                #region BeforeScanRecord event

                bool isMatch = MatchesCondition();
                BeforeScanRecordEventArgs beforeScanEvArgs = new BeforeScanRecordEventArgs(row, pos, DocumentParser.DataManager, isMatch);
                DocumentParser.RaiseBeforeScanRecordEvent(beforeScanEvArgs);

                if (beforeScanEvArgs.Cancel)
                {
                    break;
                }

                if (beforeScanEvArgs.Skip)
                {
                    pos++;
                    DocumentParser.DataManager.IncrementCurrentRecord(this.TableName);
                    continue;
                }

                #endregion

                if (isMatch)
                {
                    foreach (IControlBlock cb in Children)
                    {
                        cb.Expand();
                    }
                }

                #region AfterScanRecord event

                AfterScanRecordEventArgs afterScanEvArgs = new AfterScanRecordEventArgs(row, pos, DocumentParser.DataManager, isMatch);
                DocumentParser.RaiseAfterScanRecordEvent(afterScanEvArgs);
                if (afterScanEvArgs.Cancel)
                {
                    break;
                }

                #endregion

                pos++;
                DocumentParser.DataManager.IncrementCurrentRecord(TableName);
            }

            DocumentParser.DataManager.ResetCurrentRecord(tableName);
            DocumentParser.RaiseScanEndedEvent(new ScanEndedEventArgs(tableName, DocumentParser.DataManager));
        }
Beispiel #3
0
        private void Dc_AfterScanRecord1(object sender, AfterScanRecordEventArgs e)
        {
            if (e.TableName == "P")
            {
                int av   = e.DataManager.GetInt32("available");
                int unav = e.DataManager.GetInt32("unavailable");

                if (e.Record[2].ToString() == "Yes")
                {
                    av++;
                }
                else
                {
                    unav++;
                }

                e.DataManager.AddInt32("available", av);
                e.DataManager.AddInt32("unavailable", unav);
            }
        }
Beispiel #4
0
        private void Dc_AfterScanRecord1(object sender, AfterScanRecordEventArgs e)
        {
            if (e.TableName == "prod" && e.MatchesScanCondition)
            {
                int avail   = e.DataManager.GetInt32("avail");
                int unavail = e.DataManager.GetInt32("unavail");
                if (e.Record[3].ToString() == "Yes")
                {
                    avail++;
                }
                else
                {
                    unavail++;
                }

                //These will be set to 0 for the next vendor.
                e.DataManager.AddInt32("avail", avail);
                e.DataManager.AddInt32("unavail", unavail);
                e.DataManager.AddInt32("tot", avail + unavail);

                //Count available and unavailable products (Totals)
                int available   = e.DataManager.GetInt32("available");
                int unavailable = e.DataManager.GetInt32("unavailable");
                if (e.Record[3].ToString() == "Yes")
                {
                    available++;
                }
                else
                {
                    unavailable++;
                }

                e.DataManager.AddInt32("available", available);
                e.DataManager.AddInt32("unavailable", unavailable);
                e.DataManager.AddInt32("total", available + unavailable);
            }
        }
Beispiel #5
0
 internal void RaiseAfterScanRecordEvent(AfterScanRecordEventArgs e)
 {
     AfterScanRecord?.Invoke(this, e);
 }
Beispiel #6
0
 internal void RaiseAfterScanRecordEvent(AfterScanRecordEventArgs e)
 {
     Creator.RaiseAfterScanRecordEvent(e);
 }