示例#1
0
        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);
        }
示例#2
0
 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);
 }