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)); }
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")); }
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)); }
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)); }
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)); }
// 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)); }