Exemplo n.º 1
0
        private void AddLanguageChildItem <T>(MenuItem parent, CultureInfo culture, string text, string controller, IQueryable <T> originalDataQuery)
        {
            var store = TranslationStores.Get(CommerceInstance.Current.Name);

            var totalPending = originalDataQuery.Count() - store.TotalTranslated(culture, typeof(T))
                               + store.TotalOutOfDate(culture, typeof(T));

            parent.Items.Add(new LanguageSpecificMenuItem(culture.Name)
            {
                Text       = text,
                Controller = controller,
                Badge      = totalPending == 0 ? null : new Badge
                {
                    Text           = totalPending.ToString(),
                    HtmlAttributes = new Dictionary <string, object>
                    {
                        { "class", "badge badge-danger" }
                    }
                }
            });
        }
Exemplo n.º 2
0
 public CategoryController(IRepository <Category> repository)
 {
     _repository       = repository;
     _translationStore = TranslationStores.Get(CurrentInstance.Name);
 }
Exemplo n.º 3
0
 public BrandController(BrandService brandService)
 {
     _brandService     = brandService;
     _translationStore = TranslationStores.Get(CurrentInstance.Name);
 }
Exemplo n.º 4
0
 public ProductController()
 {
     _translationStore = TranslationStores.Get(CurrentInstance.Name);
 }
 public ProductTypeController(IRepository <ProductType> repository)
 {
     _repository       = repository;
     _translationStore = TranslationStores.Get(CurrentInstance.Name);
 }