public ActionResult Create(string time26Start, string time26End, string timeCNStart, string timeCNEnd, Contact contact) { contact.TimeStartEnd = time26Start + "," + time26End + "," + timeCNStart + "," + timeCNEnd; if (ModelState.IsValid) { db.Contacts.Add(contact); db.SaveChanges(); return RedirectToAction("Index"); } return View(contact); }
public ActionResult Edit(string time26Start, string time26End, string timeCNStart, string timeCNEnd, Contact contact) { contact.TimeStartEnd = time26Start + "," + time26End + "," + timeCNStart + "," + timeCNEnd; if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(contact); }