private DisplayDetailsViewModel GetUserDetails(string Id) { var user = (from u in UserManager.Users where u.Id == Id select u) .FirstOrDefault(); var info = _IUserInformationRepository.UserInformations.FirstOrDefault(x => x.id == user.user_info_id); var user_address = _IAddressesRepository.Addresses.FirstOrDefault(x => x.id == info.address_id); AccountDetails acc = new AccountDetails { ID = user.Id, Email = user.Email, PhoneNumber = user.PhoneNumber }; AddressDetails address = new AddressDetails { AddressID = user_address.id, City = user_address.city, Street = user_address.street, HouseNumber = user_address.house_number, ApartmentNumber = user_address.apartment_number, PostalCode = user_address.postal_code, PostalCity = user_address.postal_city }; PersonalDetails personal = new PersonalDetails { PersonalID = user.UserInfo.id, FirstName = user.UserInfo.first_name, LastName = user.UserInfo.last_name, Gender = user.UserInfo.gender, RegisterDate = user.UserInfo.register_date }; string photo = Url.Content("/Images/Photos/profile-photo.jpg"); if (user.UserInfo.photo_id.HasValue) { photo = user.UserInfo.Photo.url; } else if (user.UserInfo.gender == "Kobieta") { photo = Url.Content("/Images/Photos/profile-photo-female.jpg"); } var details = new DisplayDetailsViewModel { AccountDetails = acc, AddressDetails = address, PersonalDetails = personal, Photo = photo }; return(details); }
public PartialViewResult RefreshUserDetails() { var model = new DisplayDetailsViewModel { PersonalDetails = new PersonalDetails { PersonalID = 0 } }; return(PartialView("_UserDetails", model)); }
private DisplayDetailsViewModel GetDisplayDetailsViewModel() { var accountDetails = new AccountDetails { Email = CurrentUser.Email, PhoneNumber = CurrentUser.PhoneNumber }; var personalDetails = new PersonalDetails { PersonalID = CurrentUserInfo.id, FirstName = CurrentUserInfo.first_name, LastName = CurrentUserInfo.last_name, Gender = CurrentUserInfo.gender, RegisterDate = CurrentUserInfo.register_date, }; var addressDetails = new AddressDetails { AddressID = CurrentUserAddress.id, City = CurrentUserAddress.city, Street = CurrentUserAddress.street, HouseNumber = CurrentUserAddress.house_number, ApartmentNumber = CurrentUserAddress.apartment_number, PostalCode = CurrentUserAddress.postal_code, PostalCity = CurrentUserAddress.postal_city }; MedicalDetails medicalDetails = null; if (IsDoctor) { medicalDetails = new MedicalDetails { MedicalID = CurrentUserMedicalExperience.id, University = CurrentUserMedicalExperience.university, Specialization = CurrentUserMedicalExperience.specialization, GraduationDate = CurrentUserMedicalExperience.graduation_date, AboutMyself = CurrentUserMedicalExperience.about_myself }; } string photo = Url.Content("/Images/Photos/profile-photo.jpg"); if (CurrentUserInfo.photo_id.HasValue) { photo = CurrentUserInfo.Photo.url; } else if (CurrentUserInfo.gender == "Kobieta") { photo = Url.Content("/Images/Photos/profile-photo-female.jpg"); } var model = new DisplayDetailsViewModel { AccountDetails = accountDetails, PersonalDetails = personalDetails, AddressDetails = addressDetails, MedicalDetails = medicalDetails, Photo = photo }; return(model); }