Esempio n. 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);
        }
Esempio n. 2
0
        private void SetFilterType(SQLiteSettings.FilterElementModel filter)
        {
            switch (filter.Type)
            {
            case Rekod.SQLiteSettings.TypeOperation.More:
                cbListFilter.SelectedIndex = FindIndex(">");
                break;

            case Rekod.SQLiteSettings.TypeOperation.Less:
                cbListFilter.SelectedIndex = FindIndex("<");
                break;

            case Rekod.SQLiteSettings.TypeOperation.Equal:
                cbListFilter.SelectedIndex = FindIndex("=");
                break;

            case Rekod.SQLiteSettings.TypeOperation.NotEqual:
                cbListFilter.SelectedIndex = FindIndex("<>");
                break;

            case Rekod.SQLiteSettings.TypeOperation.MoreOrEqual:
                cbListFilter.SelectedIndex = FindIndex(">=");
                break;

            case Rekod.SQLiteSettings.TypeOperation.LessOrEqual:
                cbListFilter.SelectedIndex = FindIndex("<=");
                break;

            case Rekod.SQLiteSettings.TypeOperation.Empty:
                cbListFilter.SelectedIndex = FindIndex(Rekod.Properties.Resources.FindBox2_Empty);
                break;

            case Rekod.SQLiteSettings.TypeOperation.NotEmpty:
                cbListFilter.SelectedIndex = FindIndex(Rekod.Properties.Resources.FindBox2_IsNotEmpty);
                break;

            case Rekod.SQLiteSettings.TypeOperation.Included:
                cbListFilter.SelectedIndex = FindIndex(Rekod.Properties.Resources.FindBox2_Contains);
                break;

            case Rekod.SQLiteSettings.TypeOperation.IncludesFirst:
                cbListFilter.SelectedIndex = FindIndex(Rekod.Properties.Resources.FindBox2_StartsWith);
                break;

            case Rekod.SQLiteSettings.TypeOperation.NotIncluded:
                cbListFilter.SelectedIndex = FindIndex(Rekod.Properties.Resources.FindBox2_DoesNotContain);
                break;

            case Rekod.SQLiteSettings.TypeOperation.Init:
                cbListFilter.SelectedIndex = -1;
                break;

            default:
                break;
            }
        }
Esempio n. 3
0
 public SQLiteSettings.FilterElementModel GetFilterElementModel()
 {
     if (_currentFilter.TypeField != TypeField.Default)
     {
         SQLiteSettings.FilterElementModel temp = new SQLiteSettings.FilterElementModel(-1, _currentFilter.idField.ToString(),
                                                                                        GetTypeOperation(cbListFilter.Text), GetValue().ToString(), false);
         return(temp);
     }
     else
     {
         SQLiteSettings.FilterElementModel temp = new SQLiteSettings.FilterElementModel(-1, _currentFilter.idField.ToString(),
                                                                                        GetTypeOperation(cbListFilter.Text), GetValue().ToString(), false);
         return(temp);
     }
 }