Пример #1
0
 // GET: Contacts/Details/5
 public ActionResult ContactsDetails(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ContactsViewModel contactsView = new ContactsViewModel(id);
     if (contactsView == null)
     {
         return HttpNotFound();
     }
     return View(contactsView);
 }
Пример #2
0
        public ActionResult ContactsEdit(ContactsViewModel cvm)
        {
            Contacts contacts = cvm.contact;
            contacts.DistKey = GlobalVariables.DistKey;

            if (ModelState.IsValid)
            {
                db.Entry(contacts).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("ContactsIndex");
            }
            return View(contacts);
        }
Пример #3
0
 // GET: Contacts/Edit/5
 public ActionResult ContactsEdit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ContactsViewModel cvm = new ContactsViewModel(id);
     return View(cvm);
 }