Ejemplo n.º 1
0
 protected void OnNextPacket(PacketEventArgs value)
 {
     PacketEventHandler handler = (PacketEventHandler)base.Events[EventOnNextPacket];
     if (handler != null)
     {
         handler(this, value);
     }
 }
Ejemplo n.º 2
0
 void DataSource_NextPacket(object sender, PacketEventArgs e)
 {
     if (e.State == PacketEventArgs.PacketState.Before)
     {
         e.Cancel = closepacketrecord;
     }
 }
Ejemplo n.º 3
0
        public bool GetNextPacket()
        {
            if (Eof) return false;
            // if (!Active) return false;

            if ((null != RemoteName) && !RemoteName.Equals(""))
            {
                PacketEventArgs e = new PacketEventArgs(PacketEventArgs.PacketState.Before);
                OnNextPacket(e);
                if (e.Cancel)
                {
                    return false;
                }
                string s = RemoteName;
                int iPos = s.IndexOf('.');
                string s1 = s.Substring(0, iPos);
                string s2 = s.Substring(iPos + 1, s.Length - iPos - 1);
                DataSet aDataSet = null;
                if (s1 == "GLModule" && s2 == "cmdRefValUse")
                {
                    aDataSet = (DataSet)(CliUtils.ExecuteSql(s1, s2, refCommandText, refDBAlias, true, CliUtils.fCurrentProject, new object[] { this.PacketRecords, LastIndex }));
                }
                else
                {
                    aDataSet = (DataSet)(CliUtils.GetSqlCommand(s1, s2, this, WhereStr, "", CommandText, WhereParam, OrderStr));//更改过排序后, 取一批也要保持同一排序
                }
                if (-1 != PacketRecords)
                {
                    if (aDataSet.Tables[0].Rows.Count < PacketRecords)
                        Eof = true;

                    LastIndex += aDataSet.Tables[0].Rows.Count;
                }

                fRealDataSet.Merge(aDataSet);
                OnNextPacket(new PacketEventArgs(PacketEventArgs.PacketState.After));
                return true;
            }

            return false;
        }