Beispiel #1
0
        public void SetFilter(SQLiteSettings.FilterElementModel filter, List <UcTableObjects.FieldInfoFull> fList)
        {
            fieldInfo fi = classesOfMetods.getFieldInfo(Convert.ToInt32(filter.Column));

            switch (fi.type)
            {
            case 1:
                txtValue.Text = filter.Value.ToString();
                break;

            case 2:
                txtValue.Text = filter.Value.ToString();
                break;

            case 3:
                dateTimePicker1.Value = Convert.ToDateTime(filter.Value);
                break;

            case 4:
                dateTimePicker1.Value = Convert.ToDateTime(filter.Value);
                break;

            case 6:
                txtValue.Text = filter.Value.ToString();
                break;

            default:
                txtValue.Text = filter.Value.ToString();
                break;
            }

            _currentFilter = fList.Find(w => w.idField == fi.idField);
            this.ListIS    = fList;
            SetFilterType(filter);
        }
Beispiel #2
0
        private void CbListColumnSelectedIndexChanged(object sender, EventArgs e)
        {
            _currentFilter = cbListColumn.SelectedItem as UcTableObjects.FieldInfoFull;
            setValid();
            var currentText = cbListFilter.Text;

            cbListFilter.Items.Clear();
            if (_currentFilter == null)
            {
                return;
            }
            //DateTime? date;
            if (_currentFilter.is_reference)
            {
                SetObject(true, GetValue());
                cbListFilter.Items.AddRange(_findListText);
            }
            else
            {
                switch (_currentFilter.TypeField)
                {
                case TypeField.Integer:
                    SetObject(true, GetValue());
                    cbListFilter.Items.AddRange(_findListNum);
                    break;

                case TypeField.Numeric:
                    SetObject(true, GetValue());
                    cbListFilter.Items.AddRange(_findListNum);
                    break;

                case TypeField.Date:
                    SetObject(false, GetValue());
                    cbListFilter.Items.AddRange(_findListNum);
                    break;

                case TypeField.DateTime:
                    SetObject(false, GetValue());
                    cbListFilter.Items.AddRange(_findListNum);
                    break;

                default:
                    SetObject(true, GetValue());
                    cbListFilter.Items.AddRange(_findListText);
                    break;
                }
            }
            cbListFilter.Items.AddRange(_findList);
            cbListFilter.Text = currentText;
            if (cbListFilter.SelectedIndex == -1)
            {
                cbListFilter.SelectedIndex = 0;
            }
        }
Beispiel #3
0
        public FindBox2(UcTableObjects.FieldInfoFull key, object value)
            : this()
        {
            if (key == null)
            {
                return;
            }
            _currentFilter = key;
            cbListFilter.Items.Clear();
            cbListFilter.Items.AddRange(_findListNum);
            cbListFilter.Items.AddRange(_findList);
            cbListFilter.SelectedIndex = 0;
            switch (key.TypeField)
            {
            case TypeField.Default:
                txtValue.Text = value.ToString();
                break;

            case TypeField.Integer:
                txtValue.Text = value.ToString();
                break;

            case TypeField.Text:
                txtValue.Text = value.ToString();
                break;

            case TypeField.Date:
                dateTimePicker1.Value = Convert.ToDateTime(value);
                break;

            case TypeField.DateTime:
                dateTimePicker1.Value = Convert.ToDateTime(value);
                break;

            case TypeField.Numeric:
                txtValue.Text = value.ToString();
                break;

            default:
                txtValue.Text = value.ToString();
                break;
            }
        }
Beispiel #4
0
 public FindRequest2(UcTableObjects.FieldInfoFull coll, object findd, string type)
 {
     Col       = coll;
     FindValue = findd;
     TypeFr    = type;
 }