public ActionResult EditProfile(DoctorModel model) { if (ModelState.IsValid) { var profile = new Doctor(); profile.FirstName = model.FirstName; profile.LastName = model.LastName; profile.Gender = model.Gender; profile.MobileNumber = model.MobileNumber; profile.Age = model.Age; profile.Specialization = model.Specialization; _doctorService.EditProfile(profile, User.Identity.Name); //address var address = new Address(); address.HouseNo = model.HouseNo; address.RoadNo = model.RoadNo; address.Thana = model.Thana; address.Zilla = model.Zilla; _doctorService.UpdateAddress(address, User.Identity.Name); Session["Success"] = "Profile Updated Successfully"; } else { Session["Error"] = "Sorry, Profile Cannot Be Updated"; } return View(model); }
public void SaveAddress(Address address, String userName) { address.UserId = _userRepository.GetUserId(userName); _addressRepository.Add(address); }
public void UpdateAddress(Address address, String userName) { _addressRepository.Update(address, _userRepository.GetUserId(userName)); }