public ActionResult DeleteConfirmed(int id) { ConterpartyModel conterpartyModel = db.Conterparties.Find(id); db.Conterparties.Remove(conterpartyModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,MobilePhone,Fax,LegalAddres,ActualAddres,Email,Comments")] ConterpartyModel conterpartyModel) { if (ModelState.IsValid) { db.Entry(conterpartyModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(conterpartyModel)); }
public ActionResult Create([Bind(Include = "Id,Name,MobilePhone,Fax,LegalAddres,ActualAddres,Email,Comments")] ConterpartyModel conterpartyModel) { if (ModelState.IsValid) { db.Conterparties.Add(conterpartyModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(conterpartyModel)); }
// GET: Conterparty/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ConterpartyModel conterpartyModel = db.Conterparties.Find(id); if (conterpartyModel == null) { return(HttpNotFound()); } return(View(conterpartyModel)); }