Beispiel #1
0
        internal string SaveUserProfileData(UserProfileData userProfile, string email)
        {
            using (EmployeeOnboardEntities db = new EmployeeOnboardEntities())
            {
                try
                {
                    if (db.UserOfferDetails.Where(x => x.emailID == email).SingleOrDefault().isSubmitted == false)
                    {
                        UserProfile profiledata = db.UserProfiles.Include("AdditionalDatas")
                                                  .Include("FunctionalSkillDatas")
                                                  .Include("CertificationDatas")
                                                  .Include("EmployerDatas")
                                                  .Include("InsuranceDatas")
                                                  .Include("MembershipDatas")
                                                  .Include("PersonalDatas")
                                                  .Include("QualificationDatas")
                                                  .Include("TainingDatas")
                                                  .Include("TechnicalSkillDatas").Where(s => s.email == email).FirstOrDefault();

                        if (profiledata != null)
                        {
                            profiledata = UpdateProfileData(userProfile, profiledata);

                            db.SaveChanges();
                        }
                        else
                        {
                            UserProfile profile = GenerateProfileData(userProfile, email);

                            db.UserProfiles.Add(profile);
                            db.SaveChanges();
                        }

                        return("Data is saved Successfully");
                    }
                    else
                    {
                        return("Data is already submitted cannot make any further changes");
                    }
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
Beispiel #2
0
 internal string SubmitUserData(string email)
 {
     try
     {
         using (EmployeeOnboardEntities db = new EmployeeOnboardEntities())
         {
             var data = db.UserOfferDetails.Where(x => x.emailID == email).Single();
             if (!data.isSubmitted == true)
             {
                 db.SaveChanges();
                 return("Data is submitted successfully");
             }
             else
             {
                 return("Already Submitted");
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }