public ActionResult UpdateSave(int id, string name, string spec, int syear, DateTime bdate) { db.Update(new Data { Id = id, Name = name, Spec = spec, SYear = syear, BDate = bdate }); return(RedirectToAction("index")); }
public ActionResult UpdateSave(int id, string name, string number) { try { // TODO: Add update logic here Record record = new Record(id, name, number); recordRepository.Update(record); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult UpdateSave(FormCollection collection) { try { string surname = Convert.ToString(collection["Surname"]); string phone = Convert.ToString(collection["Phone"]); long id = Convert.ToInt64(collection["Id"]); Contact updatedContact = new Contact() { Id = id, Phone = phone, Surname = surname }; phones.Update(updatedContact); return(RedirectToAction("Index")); } catch { return(View()); } }
public void Put([FromBody] Phone value) { phoneDictionary.Update(value); }
public IActionResult UpdateSave(Phone phone) { phoneDictionary.Update(phone); return(RedirectToAction("Index")); }