public ActionResult CreateEdit(long Id = 0)
        {
            NeCategory item = new NeCategory();

            if (Id > 0)
            {
                item = _neCategoryService.Get(Id);
            }
            else
            {
                NeCategoryDetails _itemDetails = new NeCategoryDetails();
                _itemDetails.Language = GlobalContext.WebSite.Language;
                item.Details.Add(_itemDetails);
            }

            if (GlobalContext.WebSite.IsMultiLangual)
            {
                foreach (var lang in SupportedCultures.Cultures)
                {
                    var count = item.Details.Where(x => x.Language == lang.TwoLetterISOLanguageName).Count();
                    if (count <= 0)
                    {
                        NeCategoryDetails _itemDetails = new NeCategoryDetails();
                        _itemDetails.Language = lang.TwoLetterISOLanguageName;
                        item.Details.Add(_itemDetails);
                    }
                }
            }
            return(View(item));
        }
Exemple #2
0
        public ActionResult CreateEdit(long Id = 0)
        {
            NeCategory item = new NeCategory();

            if (Id > 0)
            {
                item = _neCategoryService.Get(Id);
            }
            return(View(item));
        }