public ActionResult Edit(MaintenanceProvider Provider)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Provider).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(Provider);
 }
 public ActionResult ChangeAddress(MaintenanceProvider Provider)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Provider).State = EntityState.Modified;
         Provider.GoogleMap = string.IsNullOrEmpty(Provider.Address) ? UserHelper.GetFormattedLocation("", "", "USA") : UserHelper.GetFormattedLocation(Provider.Address, Provider.City, Provider.CountryCode);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(Provider);
 }
        public void RegisterProvider(RegisterModel model)
        {
            var newprovider = new MaintenanceProvider { EmailAddress = model.Email };
            var user = Membership.GetUser(model.UserName);
            if (user != null)
            {
                var providerUserKey = user.ProviderUserKey;
                if (providerUserKey != null)
                    newprovider.GUID = (Guid)providerUserKey;
                newprovider.FirstName = model.UserName;
                newprovider.Photo = "./../images/dotimages/avatar-placeholder.png";
                newprovider.GoogleMap = "USA";
            }

            _db.MaintenanceProviders.Add(newprovider);
            _db.SaveChanges();

        }