public ActionResult BiographyEdit([Bind(Include = "ManagementBiographyID,ManagementPersonName,Info")] ManagementBiography managementBiography) { if (ModelState.IsValid) { managementBiography.Info = HttpUtility.HtmlEncode(managementBiography.Info); db.Entry(managementBiography).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Biographies")); } return(View(managementBiography)); }
public void SelectAttachModified() { Logger.Log.Error("### SelectAttachModified #############################################"); t_Account account = null; using (var context = new CommonContext()) { account = (from row in context.Account select row).Take(1).ToList().Single(); account.Cash += 1; account.Gold += 1; } // attach 이후 변경이 되어야 업데이트가 가능하다. using (var context = new CommonContext()) { context.Account.Attach(account); account.Cash += 1; account.Gold += 1; context.SaveChanges(); } using (var context = new CommonContext()) { context.Entry(account).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } Logger.Log.Debug("##"); }
public bool Update(Oferta obj) { var guardado = false; Bd.Entry(obj).State = System.Data.Entity.EntityState.Modified; var i = Bd.SaveChanges(); guardado = i > 0; return(guardado); }
public ActionResult Edit([Bind(Include = "NewsID,Title,Content,PostDate")] News news) { if (ModelState.IsValid) { db.Entry(news).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(news)); }
public ActionResult Edit([Bind(Include = "NewsPhotoID,NewsID,PhotoLocation")] NewsPhotoDetail newsPhoto) { if (ModelState.IsValid) { db.Entry(newsPhoto).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.NewsID = new SelectList(db.News, "NewsID", "Title", newsPhoto.NewsID); return(View(newsPhoto)); }