public async Task <IActionResult> Edit(int id, [Bind("Id")] RoboticsDevelopmentAndDevelopmentTools roboticsDevelopmentAndDevelopmentTools)
        {
            if (id != roboticsDevelopmentAndDevelopmentTools.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(roboticsDevelopmentAndDevelopmentTools);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoboticsDevelopmentAndDevelopmentToolsExists(roboticsDevelopmentAndDevelopmentTools.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(roboticsDevelopmentAndDevelopmentTools));
        }
        public async Task <IActionResult> Create([Bind("Id")] RoboticsDevelopmentAndDevelopmentTools roboticsDevelopmentAndDevelopmentTools)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roboticsDevelopmentAndDevelopmentTools);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(roboticsDevelopmentAndDevelopmentTools));
        }
예제 #3
0
        public async Task <IActionResult> Create(int RoboticsDevelopmentAndDevelopmentTools, [Bind("Id,Name,Description,Roboticsdevelopmentanddevelopmenttools,Language")] RoboticsDevelopmentAndDevelopmentToolsTrans roboticsDevelopmentAndDevelopmentToolsTrans)
        {
            if (ModelState.IsValid)
            {
                if (RoboticsDevelopmentAndDevelopmentTools == 0)
                {
                    RoboticsDevelopmentAndDevelopmentTools entry = new RoboticsDevelopmentAndDevelopmentTools(); _context.Add(entry); roboticsDevelopmentAndDevelopmentToolsTrans.Roboticsdevelopmentanddevelopmenttools = entry.Id;
                }

                _context.Add(roboticsDevelopmentAndDevelopmentToolsTrans);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["Language"] = new SelectList(_context.Languages, "Id", "Code", roboticsDevelopmentAndDevelopmentToolsTrans.Language);
            ViewData["Roboticsdevelopmentanddevelopmenttools"] = new SelectList(_context.RoboticsDevelopmentAndDevelopmentTools, "Id", "Id", roboticsDevelopmentAndDevelopmentToolsTrans.Roboticsdevelopmentanddevelopmenttools);
            return(View(roboticsDevelopmentAndDevelopmentToolsTrans));
        }