public async Task <ActionResult> DeleteConfirmed(int id) { company_persons company_persons = await db.company_persons.FindAsync(id); db.company_persons.Remove(company_persons); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "company_person_id,identity_user_id,company_id,first_name,last_name,email,phone_number,active,last_update")] company_persons company_persons) { if (ModelState.IsValid) { db.Entry(company_persons).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.company_id = new SelectList(db.companies, "company_id", "name", company_persons.company_id); ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", company_persons.identity_user_id); return(View(company_persons)); }
// GET: CompanyPersons/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } company_persons company_persons = await db.company_persons.FindAsync(id); if (company_persons == null) { return(HttpNotFound()); } return(View(company_persons)); }
// GET: CompanyPersons/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } company_persons company_persons = await db.company_persons.FindAsync(id); if (company_persons == null) { return(HttpNotFound()); } ViewBag.company_id = new SelectList(db.companies, "company_id", "name", company_persons.company_id); ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", company_persons.identity_user_id); return(View(company_persons)); }