public PersonalDetailsViewModel GetPersonalDetails(int? id)
        {
            PersonalDetailsViewModel personalDetailsViewModel = new PersonalDetailsViewModel();
            personalDetailsViewModel.personalDetailsModel = new Models.PersonalDetailsModel();
            PersonalDetailsBusinessLayer pdBal = new PersonalDetailsBusinessLayer();
            PersonalDetails pd = pdBal.GetPersonalDetailsByID(id);
            if (pd == null)
            {
            }
            else
            {
                personalDetailsViewModel.personalDetailsModel.ID = pd.ID;
                personalDetailsViewModel.personalDetailsModel.firstName = pd.firstName;
                personalDetailsViewModel.personalDetailsModel.lastName = pd.lastName;
                personalDetailsViewModel.personalDetailsModel.contactNumber = pd.contactNumber;
                personalDetailsViewModel.personalDetailsModel.profession = pd.profession;
                personalDetailsViewModel.personalDetailsModel.currentCity = pd.currentCity;
                personalDetailsViewModel.personalDetailsModel.currentCountry = pd.currentCountry;
                personalDetailsViewModel.personalDetailsModel.dateOfBirth = pd.dateOfBirth.ToString("yyyy-MM-dd");
                personalDetailsViewModel.personalDetailsModel.imageUrl = pd.imageUrl;
                if (personalDetailsViewModel.personalDetailsModel.imageUrl == null)
                {
                    personalDetailsViewModel.personalDetailsModel.imageUrl = "/Images/PersonalImages/no-Image.png";
                }
            }

            return personalDetailsViewModel;
        }
        public void AddPersonalInfo(PersonalDetailsModel PersonalDetailsModelClient)
        {
            var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
            var currentUser = manager.FindById(User.Identity.GetUserId());
            int id = currentUser.UserInfo.Id;

            PersonalDetails pd = new PersonalDetails();
            pd.firstName = PersonalDetailsModelClient.firstName;
            pd.lastName = PersonalDetailsModelClient.lastName;
            pd.profession = PersonalDetailsModelClient.profession;
            pd.contactNumber = PersonalDetailsModelClient.contactNumber;
            pd.currentCity = PersonalDetailsModelClient.currentCity;
            pd.currentCountry = PersonalDetailsModelClient.currentCountry;
            pd.dateOfBirth = Convert.ToDateTime(PersonalDetailsModelClient.dateOfBirth);
            pd.imageUrl = PersonalDetailsModelClient.imageUrl;
            pd.UserInfoID = id;
            PersonalDetailsBusinessLayer pdBal = new PersonalDetailsBusinessLayer();
            pdBal.InsertPersonalDetails(pd);
        }
 public void UpdatePersonalInfo(PersonalDetails PersonalDetailsModelClient)
 {
     PersonalDetailsBusinessLayer pdBal = new PersonalDetailsBusinessLayer();
     pdBal.UpdatePersonalDetails(PersonalDetailsModelClient);
 }