コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("CompanyClass_Id,CompanyClass_Name")] Company_Classification company_Classification)
        {
            if (id != company_Classification.CompanyClass_Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company_Classification);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Company_ClassificationExists(company_Classification.CompanyClass_Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(company_Classification));
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Company_Classification company_Classification = db.Company_Classification.Find(id);

            db.Company_Classification.Remove(company_Classification);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "CompanyClass_Id,CompanyClass_Name")] Company_Classification company_Classification)
 {
     if (ModelState.IsValid)
     {
         db.Entry(company_Classification).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(company_Classification));
 }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("CompanyClass_Id,CompanyClass_Name")] Company_Classification company_Classification)
        {
            if (ModelState.IsValid)
            {
                _context.Add(company_Classification);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(company_Classification));
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "CompanyClass_Id,CompanyClass_Name")] Company_Classification company_Classification)
        {
            if (ModelState.IsValid)
            {
                db.Company_Classification.Add(company_Classification);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(company_Classification));
        }
コード例 #6
0
        // GET: Company_Classification/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Company_Classification company_Classification = db.Company_Classification.Find(id);

            if (company_Classification == null)
            {
                return(HttpNotFound());
            }
            return(View(company_Classification));
        }