示例#1
0
 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);
 }
示例#2
0
文件: DoctorService.cs 项目: x3r/AMS
 public void SaveAddress(Address address, String userName)
 {
     address.UserId = _userRepository.GetUserId(userName);
     _addressRepository.Add(address);
 }
示例#3
0
文件: DoctorService.cs 项目: x3r/AMS
 public void UpdateAddress(Address address, String userName)
 {
     _addressRepository.Update(address, _userRepository.GetUserId(userName));
 }