public async Task <IActionResult> Create([Bind("ID,Name")] ComponentSpecificationCategory componentSpecificationCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(componentSpecificationCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(componentSpecificationCategory));
        }
        public async Task <IActionResult> Create([Bind("ID,Name,Description,DateAdded,DateModified")] HardwareComponent hardwareComponent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hardwareComponent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(hardwareComponent));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,NameCategory,DateAdded")] CategoryNews categoryNews)
        {
            if (ModelState.IsValid)
            {
                _context.Add(categoryNews);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categoryNews));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,ImageName,Title,Active,UrlName,HardwareComponentId")] HardwareUnit hardwareUnit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hardwareUnit);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HardwareComponentId"] = new SelectList(_context.HardwareComponents, "ID", "Name", hardwareUnit.HardwareComponentId);
            return(View(hardwareUnit));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Active,HardwareComponentId")] FilterCategory filterCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(filterCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HardwareComponentId"] = new SelectList(_context.HardwareComponents, "ID", "Name", filterCategory.HardwareComponentId);
            return(View(filterCategory));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("ID,Name,FilterCategoryId")] FilterComponent filterComponent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(filterComponent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FilterCategoryId"] = new SelectList(_context.FilterCategories, "Id", "Name");
            return(View(filterComponent));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("Id,Title,ImageName,Descriprion,MetaDescription,MetaTitle,KeyWords,DateAdded,DateModified,Author,CategoryNewsId")] Articles articles)
        {
            if (ModelState.IsValid)
            {
                _context.Add(articles);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryNewsId"] = new SelectList(_context.CategoryNews, "Id", "NameCategory", articles.CategoryNewsId);
            return(View(articles));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("ID,AttributeName,DateAdded,Primary,HardwareComponentId,ComponentSpecificationCategoryId")] ComponentSpecification componentSpecification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(componentSpecification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComponentSpecificationCategoryId"] = new SelectList(_context.ComponentSpecificationCategories, "ID", "Name", componentSpecification.ComponentSpecificationCategoryId);
            ViewData["HardwareComponentId"] = new SelectList(_context.HardwareComponents, "ID", "Name", componentSpecification.HardwareComponentId);
            return(View(componentSpecification));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Create([Bind("Id,AttributeValue,ShortInfo,FilterComponentId,HardwareUnitId,ComponentSpecificationId")] HardwareUnitSpecification hardwareUnitSpecification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hardwareUnitSpecification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComponentSpecificationId"] = new SelectList(_context.ComponentSpecifications, "ID", "AttributeName", hardwareUnitSpecification.ComponentSpecificationId);
            ViewData["FilterComponentId"]        = new SelectList(_context.FilterComponents, "ID", "Name", hardwareUnitSpecification.FilterComponentId);
            ViewData["HardwareUnitId"]           = new SelectList(_context.HardwareUnits, "Id", "Title", hardwareUnitSpecification.HardwareUnitId);
            return(View(hardwareUnitSpecification));
        }