示例#1
0
 protected void OnSetWhereing(SetWhereArgs value)
 {
     SetWhereEventHandler handler = (SetWhereEventHandler)base.Events[EventOnSetWhereing];
     if (handler != null)
     {
         handler(this, value);
     }
 }
示例#2
0
        public bool SetWhere(string strWhere, ArrayList param)
        {
            SetWhereArgs args = new SetWhereArgs(strWhere, param);
            OnSetWhereing(args);
            if (args.Cancel)
            {
                return false;
            }
            this.WhereStr = args.WhereStr;
            this.WhereParam = args.WhereParam;
            if (this.RemoteName != null && this.RemoteName.Trim() != "")
            {
                InfoDataSet infoDataSet = new InfoDataSet();
                infoDataSet.DataCompressed = DataCompressed;
                infoDataSet.RemoteName = this.RemoteName;
                infoDataSet.PacketRecords = this.PacketRecords;
                // infoDataSet.LastKeyValues = null;
                infoDataSet.LastIndex = -1;
                infoDataSet.WhereStr = this.WhereStr;
                if (infoDataSet.WhereParam != null)
                    infoDataSet.WhereParam.Clear();
                infoDataSet.WhereParam = this.WhereParam;
                infoDataSet.Active = true;
                this.InnerDataSet = infoDataSet.RealDataSet;
                // this.LastKeyValues = infoDataSet.LastKeyValues;
                this.LastIndex = infoDataSet.LastIndex;
                this.Eof = infoDataSet.Eof;
            }
            else
            {
                this.LastIndex = -1;
                string strSql = CliUtils.InsertWhere(this.SelectCommand, this.WhereStr);
                DataSet ds = new DataSet();
                ds = CliUtils.ExecuteSql("GLModule", "cmdRefValUse", strSql, null, true, CliUtils.fCurrentProject, new object[] { this.CommandPacketRecords, this.LastIndex }, this.WhereParam);
                if (ds != null && ds.Tables.Count != 0 && ds.Tables[0] != null)
                {
                    this.CommandTable = ds.Tables[0];
                }
            }
            if (View != null && View.Count > 0)
            {
                SetPostion(0);
            }
            else
            {
                SetPostion(-1);
            }

            return true;
        }