//[-]

        void Selection_AddFilter()
        {
            DataTable      Dt_FilterFields = (DataTable)this.ViewState[CnsDt_FilterFields];
            string         FilterSt        = "";
            QueryCondition Qc = (QueryCondition)this.ViewState[CnsObj_QueryCondition];

            if (Qc == null)
            {
                Qc = new QueryCondition();
            }

            DataRow[] ArrDr = Dt_FilterFields.Select("Field = '" + this.Cbo_SearchFilter.SelectedValue + "'");
            if (ArrDr.Length > 0)
            {
                Qc.Add(
                    (string)Do_Methods.IsNull(ArrDr[0]["Field"], "")
                    , this.Txt_Search.Text
                    , (string)Do_Methods.IsNull(ArrDr[0]["DataType"], ""));
                FilterSt = this.Cbo_SearchFilter.SelectedItem.Text + " by " + this.Txt_Search.Text;
            }

            this.ViewState[CnsObj_QueryCondition] = Qc;

            string ViewState_DisplayFilterString = (string)this.ViewState[CnsDisplayFilterString];

            ViewState_DisplayFilterString         += @"<br />" + FilterSt;
            this.ViewState[CnsDisplayFilterString] = ViewState_DisplayFilterString;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Combine queue.
        /// </summary>
        public override void Combine()
        {
            if (Sq.Length < 2)
            {
                return;
            }

            char[] items = Sq.TwoLatestItems;

            var t = Qc.GetCombine(items[0], items[1]);

            if (t != 0)
            {
                Sq.RemoveElement();
                Sq.RemoveElement();
                Sq.AddElement(t);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Oppose queue.
        /// </summary>
        public override void Oppose()
        {
            if (Sq.Length < 2)
            {
                return;
            }

            var c = Sq.LastItem;

            foreach (char item in Sq.UniqueItems)
            {
                if (Qc.IsOpposed(item, c))
                {
                    Sq.Clear();

                    return;
                }
            }
        }