Exemplo n.º 1
0
 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"));
 }
Exemplo n.º 2
0
        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());
            }
        }
Exemplo n.º 3
0
 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());
     }
 }
Exemplo n.º 4
0
 public void Put([FromBody] Phone value)
 {
     phoneDictionary.Update(value);
 }
Exemplo n.º 5
0
 public IActionResult UpdateSave(Phone phone)
 {
     phoneDictionary.Update(phone);
     return(RedirectToAction("Index"));
 }