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

            _db.Specialists.Add(newspecialist);
            _db.SaveChanges();

        }