Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,Roboticsdevelopmentanddevelopmenttools,Language")] RoboticsDevelopmentAndDevelopmentToolsTrans roboticsDevelopmentAndDevelopmentToolsTrans)
        {
            if (id != roboticsDevelopmentAndDevelopmentToolsTrans.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(roboticsDevelopmentAndDevelopmentToolsTrans);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoboticsDevelopmentAndDevelopmentToolsTransExists(roboticsDevelopmentAndDevelopmentToolsTrans.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Example #2
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));
        }