public ActionResult New(DistributorContactInfoViewModel dcRequest)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ContactInfo contact = new ContactInfo
             {
                 PhoneNumber = dcRequest.PhoneNumber,
                 Email       = dcRequest.Email
             };
             //vom adauga in baza de date ambele obiecte
             db.ContactInfos.Add(contact);
             Distributor distributor = new Distributor
             {
                 DistributorName = dcRequest.DistributorName,
                 ContactInfo     = contact
             };
             db.Distributors.Add(distributor);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(dcRequest));
     }
     catch (Exception e)
     {
         return(View(dcRequest));
     }
 }
        public ActionResult New()
        {
            DistributorContactInfoViewModel dc = new DistributorContactInfoViewModel();

            return(View(dc));
        }