Пример #1
0
    protected void OnItemsRequestedByFilterCondition_View(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
    {
        BootstrapComboBox editor = source as BootstrapComboBox;

        editor.DataSource = ItemTypeFactory.GetItemSubTypes().Where(s => s.SubTypeDescription.Contains(e.Filter) ||
                                                                    s.SubTypeName.Contains(e.Filter) ||
                                                                    s.SubTypeID.ToString().Contains(e.Filter));
        editor.DataBind();
    }
Пример #2
0
    protected void OnItemRequestedByValue_View(object source, ListEditItemRequestedByValueEventArgs e)
    {
        if (e.Value == null)
        {
            return;
        }
        int subTypeID            = (int)e.Value;
        BootstrapComboBox editor = source as BootstrapComboBox;

        editor.DataSource = ItemTypeFactory.GetItemSubTypes().Where(s => s.SubTypeID == subTypeID);
        editor.DataBind();
    }
Пример #3
0
    protected void OnItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
    {
        BootstrapComboBox editor = source as BootstrapComboBox;
        int            typeID    = GetCurrentItemTypeID();
        List <SubType> subTypes;

        if (typeID > -1)
        {
            subTypes = ItemTypeFactory.GetItemSubTypes().Where(s => s.TypeID == typeID && (s.SubTypeDescription.Contains(e.Filter) ||
                                                                                           s.SubTypeName.Contains(e.Filter) ||
                                                                                           s.SubTypeID.ToString().Contains(e.Filter))).ToList();
        }
        else
        {
            subTypes = ItemTypeFactory.GetItemSubTypes().Where(s => s.SubTypeDescription.Contains(e.Filter) ||
                                                               s.SubTypeName.Contains(e.Filter) ||
                                                               s.SubTypeID.ToString().Contains(e.Filter)).ToList();
        }
        editor.DataSource = subTypes;
        editor.DataBind();
    }
Пример #4
0
    protected void OnItemRequestedByValue(object source, ListEditItemRequestedByValueEventArgs e)
    {
        if (e.Value == null)
        {
            return;
        }
        string            id     = e.Value.ToString();
        BootstrapComboBox editor = source as BootstrapComboBox;
        int            typeID    = GetCurrentItemTypeID();
        List <SubType> subTypes;

        if (typeID > -1)
        {
            subTypes = ItemTypeFactory.GetItemSubTypes().Where(s => s.TypeID == typeID && s.SubTypeID.ToString() == id).ToList();
        }
        else
        {
            subTypes = ItemTypeFactory.GetItemSubTypes().Where(s => s.TypeID == typeID).ToList();
        }
        editor.DataSource = subTypes;
        editor.DataBind();
    }