示例#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"));
 }
示例#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());
            }
        }
示例#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());
     }
 }
示例#4
0
 public void Put([FromBody] Phone value)
 {
     phoneDictionary.Update(value);
 }
示例#5
0
 public IActionResult UpdateSave(Phone phone)
 {
     phoneDictionary.Update(phone);
     return(RedirectToAction("Index"));
 }