Exemple #1
0
        public async Task <IActionResult> Create(ProductTypes pt)
        {
            if (ModelState.IsValid)
            {
                if (orm == 1)
                {
                    qdb.Inproducttype(pt);
                }
                else
                {
                    _db.Add(pt);
                    await _db.SaveChangesAsync();
                }
                TempData["create"] = 1;
                return(RedirectToAction(nameof(Index)));
            }

            return(View(pt));
        }