Example #1
0
        private void btClear_Click(object sender, EventArgs e)
        {
            I3SearchItem item = (I3SearchItem)gridSearch.BindingContext[searchInfo.Items].Current;

            item.SearchType = I3SearchType.stNone;
            item.RefreshResult();

            viewSearch.UpdateCurrentRow();
        }
Example #2
0
 public void Copy(I3SearchInfo source)
 {
     FirstIsAnd = source.FirstIsAnd;
     Items.Clear();
     foreach (I3SearchItem item in source.Items)
     {
         I3SearchItem tmpItem = new I3SearchItem();
         tmpItem.FieldName    = item.FieldName;
         tmpItem.FieldCaption = item.FieldCaption;
         tmpItem.FieldType    = item.FieldType;
         tmpItem.SearchType   = item.SearchType;
         tmpItem.LookString   = item.LookString;
         tmpItem.SearchString = item.SearchString;
         tmpItem.String1      = item.String1;
         tmpItem.Num1         = item.Num1;
         tmpItem.Num2         = item.Num2;
         tmpItem.Date1        = item.Date1;
         tmpItem.Date2        = item.Date2;
         tmpItem.RefreshResult();
         Items.Add(tmpItem);
     }
 }
Example #3
0
        private void btOK_Click(object sender, EventArgs e)
        {
            I3SearchItem item = (I3SearchItem)gridSearch.BindingContext[searchInfo.Items].Current;

            switch (item.FieldType)
            {
            case I3SearchItemType.sitString:
                if (tabControl1.TabPages[tabControl1.SelectedIndex] == pEqual)
                {
                    item.SearchType = I3SearchType.stEqual;
                    item.String1    = edEqualString.Text;
                }
                else
                {
                    item.SearchType = I3SearchType.stDim;
                    item.String1    = edDimString.Text;
                }
                item.RefreshResult();
                break;

            case I3SearchItemType.sitNum:
                if (tabControl1.TabPages[tabControl1.SelectedIndex] == pEqual)
                {
                    item.SearchType = I3SearchType.stEqual;
                    try
                    {
                        item.Num1 = float.Parse(edEqualNum.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请输入数值作为参数!", "输入数值", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                else
                {
                    item.SearchType = I3SearchType.stInterval;
                    try
                    {
                        item.Num1 = float.Parse(edNum1.Text);
                        item.Num2 = float.Parse(edNum2.Text);
                    }
                    catch
                    {
                        MessageBox.Show("请输入数值作为参数!", "输入数值", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                item.RefreshResult();
                break;

            case I3SearchItemType.sitDate:
                if (tabControl1.TabPages[tabControl1.SelectedIndex] == pEqual)
                {
                    item.SearchType = I3SearchType.stEqual;
                    item.Date1      = edEqualDate.Value;
                }
                else
                {
                    item.SearchType = I3SearchType.stInterval;
                    item.Date1      = dp.BeginDate;
                    item.Date2      = dp.EndDate;
                }
                item.RefreshResult();
                break;

            default:
                break;
            }

            viewSearch.UpdateCurrentRow();
        }