// GET: Products/Create
        public IActionResult Create()
        {
            Products model = new Products
            {
                ProductCategoriesPicker = _combosHelper.GetComboCategories()
            };

            return(View(model));
        }
        public IActionResult Create()
        {
            ProductViewModel model = new ProductViewModel
            {
                Categories = _combosHelper.GetComboCategories(),
                IsActive   = true
            };

            return(View(model));
        }
Exemple #3
0
        public IActionResult Create()
        {
            TutorialViewModel model = new TutorialViewModel
            {
                Categories = _combosHelper.GetComboCategories()
            };

            return(View(model));
        }
Exemple #4
0
 public ProductViewModel ToProductViewModel(Product product)
 {
     return(new ProductViewModel
     {
         Categories = _combosHelper.GetComboCategories(),
         Category = product.Category,
         CategoryId = product.Category.Id,
         Description = product.Description,
         Id = product.Id,
         IsActive = product.IsActive,
         IsStarred = product.IsStarred,
         Name = product.Name,
         PriceString = $"{product.Price}",
         ProductImages = product.ProductImages
     });
 }
Exemple #5
0
 public TutorialViewModel ToTutorialViewModel(Tutorial tutorial)
 {
     return(new TutorialViewModel
     {
         Id = tutorial.Id,
         PicturePath = tutorial.PicturePath,
         Title = tutorial.Title,
         Description = tutorial.Description,
         TotalRate = tutorial.TotalRate,
         CategoryId = tutorial.Category.Id,
         Categories = _combosHelper.GetComboCategories(),
         Comments = tutorial.Comments,
         TutorialReports = tutorial.TutorialReports,
         Date = tutorial.Date
     });
 }