// Return to view after updating. public ActionResult Edit(Contact c) { ContactBAL db = new ContactBAL(); db.Update(c); return(RedirectToAction("Index")); }
// Return to view after adding a record. public ActionResult Create(Contact p) { ContactBAL db = new ContactBAL(); db.add(p); return(RedirectToAction("Index")); }
// Update a record public ActionResult Edit(int id) { ContactBAL db = new ContactBAL(); var record = db.Details(id); return(View(record)); }
// View details of a single record. public ActionResult Details(int id) { ContactBAL db = new ContactBAL(); var currentRecord = db.Details(id); return(View(currentRecord)); }
public ActionResult Index() { ContactBAL CB = new ContactBAL(); var records = CB.GetAll(); return(View(records)); }
// Return to view after deleting. public ActionResult Delete(int id) { ContactBAL db = new ContactBAL(); db.DeleteRecord(id); return(RedirectToAction("Index")); }
public ActionResult Edit(ContactRec p) { ContactBAL CB = new ContactBAL(); CB.Update(p); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { ContactBAL CB = new ContactBAL(); CB.Delete(id); return(RedirectToAction("Index")); }
public ActionResult Create(ContactRec p) { ContactBAL CB = new ContactBAL(); CB.Add(p); return(RedirectToAction("Index")); }
public ContactController(IOptions <Common.Configuration.Connection> connection, IOptions <Common.Configuration.Setting> settings) { ContactBAL = new BAL.ContactBAL(connection.Value, settings.Value); }