Exemplo n.º 1
0
    public static int GetCategoryIDByText(string category)
    {
        ModelCategory model = new ModelCategory();

        var cat = (from c in model.GetAllCategories()
                   where c.CategoryName_V.Contains(category)
                   select c.CategoryID_N).FirstOrDefault();

        if (cat != null)
        {
            return(cat);
        }
        else
        {
            return(0);
        }
    }
Exemplo n.º 2
0
    private void BindCategory(ICategoryView catListView)
    {
        List <Category> categories = _modelCat.GetAllCategories();

        catListView.Categories = categories;
    }