private static void UpdateFunctionalSkillData(ref UserProfile profiledata, FunctionalSkillData data)
 {
     profiledata.FunctionalSkillDatas.Where(q => q.FSDID == data.FSDID).FirstOrDefault().Experience   = data.Experience;
     profiledata.FunctionalSkillDatas.Where(q => q.FSDID == data.FSDID).FirstOrDefault().Expertise    = data.Expertise;
     profiledata.FunctionalSkillDatas.Where(q => q.FSDID == data.FSDID).FirstOrDefault().LastWorkedOn = data.LastWorkedOn;
     profiledata.FunctionalSkillDatas.Where(q => q.FSDID == data.FSDID).FirstOrDefault().Skill        = data.Skill;
 }
        private void AddFunctionalSkillData(ref UserProfile profiledata, FunctionalSkillData functionalSkill)
        {
            FunctionalSkillData fsd = new FunctionalSkillData();

            fsd       = functionalSkill;
            fsd.UPID  = profiledata.UPID;
            fsd.FSDID = Convert.ToString(Guid.NewGuid());
            profiledata.FunctionalSkillDatas.Add(fsd);
        }
        private static UserProfile GenerateProfileData(UserProfileData userProfile, string email)
        {
            UserProfile profile = new UserProfile();

            profile.UPID  = Convert.ToString(Guid.NewGuid());
            profile.email = email;

            if (userProfile.personalData != null)
            {
                PersonalData pd = new PersonalData();

                pd = userProfile.personalData;

                pd.UPID = profile.UPID;
                pd.PDID = Convert.ToString(Guid.NewGuid());
                profile.PersonalDatas.Add(pd);
            }
            if (userProfile.qualificationData != null)
            {
                QualificationData qd = new QualificationData();
                foreach (var qualification in userProfile.qualificationData)
                {
                    qd      = qualification;
                    qd.UPID = profile.UPID;
                    qd.QDID = Convert.ToString(Guid.NewGuid());
                    profile.QualificationDatas.Add(qd);
                }
            }
            if (userProfile.fileData != null)
            {
                FileData fd = new FileData();
                fd.UPID = profile.UPID;
                fd.FID  = Convert.ToString(Guid.NewGuid());
                profile.FileDatas.Add(fd);
            }
            if (userProfile.technicalSkillData != null)
            {
                foreach (var technicalSkill in userProfile.technicalSkillData)
                {
                    TechnicalSkillData tsd = new TechnicalSkillData();
                    tsd       = technicalSkill;
                    tsd.UPID  = profile.UPID;
                    tsd.TSDID = Convert.ToString(Guid.NewGuid());
                    profile.TechnicalSkillDatas.Add(tsd);
                }
            }
            if (userProfile.functionalSkillData != null)
            {
                foreach (var functionalSkill in userProfile.functionalSkillData)
                {
                    FunctionalSkillData fsd = new FunctionalSkillData();
                    fsd       = functionalSkill;
                    fsd.UPID  = profile.UPID;
                    fsd.FSDID = Convert.ToString(Guid.NewGuid());
                    profile.FunctionalSkillDatas.Add(fsd);
                }
            }
            if (userProfile.certificationData != null)
            {
                foreach (var certification in userProfile.certificationData)
                {
                    CertificationData cd = new CertificationData();
                    cd      = certification;
                    cd.UPID = profile.UPID;
                    cd.CDID = Convert.ToString(Guid.NewGuid());
                    profile.CertificationDatas.Add(cd);
                }
            }
            if (userProfile.trainingData != null)
            {
                foreach (var training in userProfile.trainingData)
                {
                    TainingData td = new TainingData();
                    td      = training;
                    td.UPID = profile.UPID;
                    td.TDID = Convert.ToString(Guid.NewGuid());
                    profile.TainingDatas.Add(td);
                }
            }
            if (userProfile.EmployerData != null)
            {
                foreach (var employerData in userProfile.EmployerData)
                {
                    EmployerData ed = new EmployerData();
                    ed      = employerData;
                    ed.UPID = profile.UPID;
                    ed.EDID = Convert.ToString(Guid.NewGuid());
                    profile.EmployerDatas.Add(ed);
                }
            }
            if (userProfile.MemberShipData != null)
            {
                foreach (var membershipData in userProfile.MemberShipData)
                {
                    MembershipData md = new MembershipData();
                    md      = membershipData;
                    md.UPID = profile.UPID;
                    md.MDID = Convert.ToString(Guid.NewGuid());
                    profile.MembershipDatas.Add(md);
                }
            }
            if (userProfile.insuranceData != null)
            {
                InsuranceData id = new InsuranceData();
                id      = userProfile.insuranceData;
                id.UPID = profile.UPID;
                id.IDID = Convert.ToString(Guid.NewGuid());

                profile.InsuranceDatas.Add(id);
            }
            if (userProfile.additionalData != null)
            {
                AdditionalData ad = new AdditionalData();
                ad      = userProfile.additionalData;
                ad.UPID = profile.UPID;
                ad.ADID = Convert.ToString(Guid.NewGuid());

                profile.AdditionalDatas.Add(ad);
            }
            return(profile);
        }