Ejemplo n.º 1
0
        /// <summary>
        /// 搜索事件方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void SearchButtonClick(object sender, EventArgs eventArgs)
        {
            if (this._inputBox != null)
            {
                if (SearchField.IsNotEmpty() && InputText.IsNotEmpty())
                {
                    ReplaceWhereItem(SearchField, InputText, SearchFieldTemplate, true);
                }
            }

            DealWithSearchField();

            var newArgs = new SearchEventArgs();

            if (this.HasAdvanced)
            {
                newArgs.IsSaveCondition = this._saveConditionCheckBox.Checked;
                newArgs.ConditionName   = this._conditionNameBox.Text;
            }

            OnSearching(sender, newArgs);
        }
Ejemplo n.º 2
0
        private void DealWithSearchField()
        {
            InputText = this._inputBox.Text;

            if (SearchField.IsNotEmpty())
            {
                if (InputText.IsNotEmpty())
                {
                    ReplaceWhereItem(SearchField, InputText, SearchFieldTemplate, true);
                }
                else
                {
                    WhereSqlClauses.RemoveAll(item =>
                    {
                        var curItem = (WhereSqlClauseBuilder)item;
                        if (curItem.Count > 0 && ((SqlClauseBuilderItemIUW)curItem[0]).DataField == SearchField)
                        {
                            return(true);
                        }
                        return(false);
                    });
                }
            }
        }