public async Task <ActionResult> DeleteConfirmed(int id) { CompanyClassification companyClassification = await db.CompanyClassifications.FindAsync(id); db.CompanyClassifications.Remove(companyClassification); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "CompanyClassificationId,CompanyClassificationDescription,CompanyClassificationNotes")] CompanyClassification companyClassification) { if (ModelState.IsValid) { db.Entry(companyClassification).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(companyClassification)); }
public async Task <ActionResult> Create([Bind(Include = "CompanyClassificationId,CompanyClassificationDescription,CompanyClassificationNotes")] CompanyClassification companyClassification) { if (ModelState.IsValid) { db.CompanyClassifications.Add(companyClassification); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(companyClassification)); }
public void Seed(IContext context) { var record = new CompanyClassification { Name = "Host", CreatedBy = "System" }; context.EntitySet <CompanyClassification>().AddOrUpdate(c => new { c.Name }, record); context.SaveChanges(); }
// GET: CompanyClassifications/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyClassification companyClassification = await db.CompanyClassifications.FindAsync(id); if (companyClassification == null) { return(HttpNotFound()); } return(View(companyClassification)); }