public ActionResult Create(CmCompanyRepresentative cmcompanyrepresentative) { if (ModelState.IsValid) { context.CmCompanyRepresentatives.Add(cmcompanyrepresentative); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Possibleusers = context.Users; ViewBag.PossiblecmCompanies = context.CmCompanies; return View(cmcompanyrepresentative); }
public ActionResult Edit(CmCompanyRepresentative cmcompanyrepresentative) { if (ModelState.IsValid) { context.Entry(cmcompanyrepresentative).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Possibleusers = context.Users; ViewBag.PossiblecmCompanies = context.CmCompanies; return View(cmcompanyrepresentative); }