public ActionResult CreateContact(Contact contact)
 {
     if (ModelState.IsValid)
     {
         contact.CreatedBy = User.Identity.Name;
         contact.CreatedDate = DateTime.Now;
         contact.UpdatedBy = User.Identity.Name;
         contact.UpdatedDate = DateTime.Now;
         contact.IsDelete = false;
         db.Entry(contact).State = System.Data.EntityState.Added;
         db.SaveChanges();
         return RedirectToAction("ListContacts");
     }
     return View(contact);
 }
 public ActionResult EditContact(Contact contact)
 {
     if (ModelState.IsValid)
     {
         var ct = db.Contacts.Find(contact.ContactID);
         if (ct != null)
         {
             ct.FullName = contact.FullName;
             ct.Phone = contact.Phone;
             ct.Email = contact.Email;
             ct.Address = contact.Address;
             ct.UpdatedBy = User.Identity.Name;
             ct.UpdatedDate = DateTime.Now;
             db.Entry(ct).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
     }
     return View();
 }