public ActionResult Edit([Bind(Include = "Id,CostCode,CostName,OrganizationCode,OrganizationName,ForwardedBill")] CostPlace costPlace) { if (ModelState.IsValid) { db.Entry(costPlace).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(costPlace)); }
public ActionResult Edit([Bind(Include = "Id,Name")] ContractCategory contractCategory) { if (ModelState.IsValid) { db.Entry(contractCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contractCategory)); }
// GET: Users/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } User user = db.Users.Find(id); if (user == null) { return(HttpNotFound()); } //A felhasználó költséghelyének betöltése db.Entry(user).Reference(x => x.CostPlace).Load(); //Az aktuális költséghely azonosítójának beállítása user.CostPlaceId = user.CostPlace.Id; //A lenyíló lista elemei LoadAssignableCostPlaces(user, db); return(View(user)); }
// GET: SIMCards/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SIMCard sIMCard = db.SIMCards.Find(id); if (sIMCard == null) { return(HttpNotFound()); } //A kártyához tartozó szerződéskategória betöltése db.Entry(sIMCard).Reference(x => x.ContractCategory).Load(); //Az aktuális ContractCategoryId property beállítása (a lenyíló kezdőpontjához sIMCard.ContractCategoryId = sIMCard.ContractCategory.Id; //A lenyíló elemei LoadAssignableContractCategories(sIMCard, db); return(View(sIMCard)); }