public ActionResult Edit(/*[Bind(Include = "Id,LastName,FirstName,MiddleName,Organization,Position, ContactInfoes")]*/ ContactList contactList, /*[Bind(Include = "Id,ContactList,ContactListId,Phone,Email,Skype,Other ")]*/ IEnumerable <ContactInfo> contactInfo)
        {
            SaveDataFromContactInfo saveDataFromContactInfo = new SaveDataFromContactInfo(contactList, db);
            var validAll = saveDataFromContactInfo.AllValid(Request.Params["JsonFile"].Replace("item.", ""));

            if (!string.IsNullOrWhiteSpace(validAll))
            {
                ModelState.AddModelError("", validAll);
                contactList = saveDataFromContactInfo.GetContactList(Request.Params["JsonFile"].Replace("item.", ""));
                return(View(contactList));
            }
            if (ModelState.IsValid)
            {
                db.Entry(contactList).State = EntityState.Modified;
                db.SaveChanges();
                saveDataFromContactInfo.SaveData(Request.Params["JsonFile"].Replace("item.", ""));
                return(RedirectToAction("Index"));
            }
            contactList = saveDataFromContactInfo.GetContactList(Request.Params["JsonFile"].Replace("item.", ""));
            return(View(contactList));
        }
        public ActionResult Create(/*[Bind(Include = "Id,LastName,FirstName,MiddleName,Organization,Position")]*/ ContactList contactList, IEnumerable <ContactInfo> contactInfo)
        {
            SaveDataFromContactInfo saveDataFromContactInfo = new SaveDataFromContactInfo(contactList, db);
            var validAll = saveDataFromContactInfo.AllValid(Request.Params["JsonFile"].Replace("item.", ""));

            if (!string.IsNullOrWhiteSpace(validAll))
            {
                ModelState.AddModelError("", validAll);
                contactList = saveDataFromContactInfo.GetContactList(Request.Params["JsonFile"].Replace("item.", ""));
                return(View(contactList));
            }
            if (ModelState.IsValid)
            {
                db.ContactLists.Add(contactList);
                db.SaveChanges();
                saveDataFromContactInfo.SaveData(Request.Params["JsonFile"].Replace("item.", ""));
                return(RedirectToAction("Index"));
            }
            contactList = saveDataFromContactInfo.GetContactList(Request.Params["JsonFile"].Replace("item.", ""));
            return(View(contactList));
        }