private void Button_Click_9(object sender, RoutedEventArgs e)
        {
            this.Hide();
            SecondPage me = new SecondPage();

            me.Show();
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            using (SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\SyngentaEmployee.mdf;Integrated Security=True;Connect Timeout=30"))
            // using (SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Mr.Oladipo\Desktop\SyngentaEmployee.mdf;Integrated Security=True;Connect Timeout=30"))
            //using (SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Mr.Oladipo\Desktop\SyngentaEmployee.mdf";Integrated Security=True;Connect Timeout=30"))
            {
                using (SqlCommand cmd = new SqlCommand(" select * from SyngentaTable WHERE LastName = @LastName AND Personnel = @personnel"))
                {
                    cmd.Connection = conn;
                    conn.Open();
                    cmd.Parameters.Add("@LastName", SqlDbType.NVarChar).Value  = btn_LastName.Text;
                    cmd.Parameters.Add("@personnel", SqlDbType.NVarChar).Value = btn_EmployeeNumber.Text;
                    using (SqlDataReader re = cmd.ExecuteReader())
                    {
                        if (re.Read())
                        {
                            UserInformation.CurrentLoggedInUser  = (string)re["KnownAs"];
                            UserInformation.CurrentLoggedInUser2 = (string)re["Email"];
                            SecondPage se = new SecondPage();
                            Welcome    we = new Welcome();
                            we.Show();
                            this.Hide();
                            we.txt_welcome.Text = "Welcome " + UserInformation.CurrentLoggedInUser;
                            we.txt_Emails.Text  = UserInformation.CurrentLoggedInUser2;

                            // MessageBox.Show("login success");

                            //se.txt_YourEmail.Text = UserInformation.CurrentLoggedInUser2;
                        }
                        else
                        {
                            //    MessageBox.Show("Please enter the correct credentials", "alert", MessageBoxButton.OK, MessageBoxImage.Error);
                            MessageBox.Show("Invalid login credentials. Please try again or email [email protected] for assistance", "alert", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                }
            }
        }
        //********************************************************
        //The checkbox name Stops here
        private void Button_Click_10(object sender, RoutedEventArgs e)
        {
            //Weight Mnagement
            if (Welcome.WeightManagementCHECKED == true)
            {
                WeightManagementProgramIntroduction = "<h1>Weight</h1>";
                if (chk_wightmgtR.IsChecked == true)
                {
                    WeightManagementProgramR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Weight%20Management%20Resources%20'18.pdf>Weight Management</a></p> ";
                }
                else
                {
                    WeightManagementProgramR = "";
                }

                if (chk_NutriChallR.IsChecked == true)
                {
                    NutritionChallengeR = "<p><a href=http://www.SyngentaWellbeing.com>Nutrition Challenge</a></p> ";
                }
                else
                {
                    NutritionChallengeR = "";
                }

                if (chk_ActiveHealthR.IsChecked == true)
                {
                    ActiveHealthCoachingR = "<p><a href=http://www.myactivehealth.com/syngentabenefits> ActiveHealth Coaching</a></p> ";
                }
                else
                {
                    ActiveHealthCoachingR = "";
                }

                if (chk_NutriEducationR.IsChecked == true)
                {
                    NutritionEducationR = "<p><a href=https://www.choosemyplate.gov/>Nutrition Education</a></p> ";
                }
                else
                {
                    NutritionEducationR = "";
                }

                if (chk_MobileAppR.IsChecked == true)
                {
                    MobileAppR = "<p><a href=http://http://teamspace/sites/CPreapreward/Unrestricted_Documents/Nutrition%20apps%20'18.pdf> Mobile Apps</a></p> ";
                }
                else
                {
                    MobileAppR = "";
                }

                if (chk_OnSiteFitR.IsChecked == true)
                {
                    OnSiteFitnessR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Exercise%20options%20GSO%20'18.pdf>On-Site Fitness Offers</a></p> ";
                }
                else
                {
                    OnSiteFitnessR = "";
                }

                if (chk_ActivChallR.IsChecked == true)
                {
                    ActivityChallengeR = "<p><a href=http://www.SyngentaWellbeing.com>Activity Challenge</a></p> ";
                }
                else
                {
                    ActivityChallengeR = "";
                }

                if (chk_HealthFoodR.IsChecked == true)
                {
                    HealthyFoodOptionR = "<p><a href=https://www.choosemyplate.gov/ten-tips-make-better-food-choices > Healthy Food Options</a></p> ";
                }
                else
                {
                    HealthyFoodOptionR = "";
                }

                if (chk_UpcomingR.IsChecked == true)
                {
                    UpcomingActivityEventR = "<p><a href=http://www.SyngentaWellbeing.com>Upcoming Activity Events</a></p> ";
                }
                else
                {
                    UpcomingActivityEventR = "";
                }
                WeightManagementWelcomes = WeightManagementProgramIntroduction + WeightManagementProgramR + NutritionChallengeR + ActiveHealthCoachingR + NutritionEducationR + MobileAppR + OnSiteFitnessR + ActivityChallengeR + HealthyFoodOptionR + UpcomingActivityEventR + "<p><a href=http://cms/USHealthServices/en/Reaping%20Rewards/Pages/Health_Assessment.aspx >Online Health Assessment Questionnaire</a></p> ";
            }

            // Quit Smoking

            if (Welcome.QuitChecked == true)
            {
                QuitIntroduction = "<h1>Tobacco-Free</h1>";
                if (chk_BlueCrossR.IsChecked == true)
                {
                    Quitblueecross = "<p><a href=http://www.bluecrossmn.com/healthy/public/personal/home/livehealthy/lh-health-programs-discounts/lh-stop-smoking-support> Blue Cross Blue Shield “Quit line”</a></p> ";
                }
                else
                {
                    Quitblueecross = "";
                }

                if (chk_OptumHealthR.IsChecked == true)
                {
                    QuitOptumHealth = "<p><a href=http://www.www.liveandworkwell.com/> Optum Health Program Referral</a></p> ";
                }
                else
                {
                    QuitOptumHealth = "";
                }

                QuitWelcome = QuitIntroduction + Quitblueecross + QuitOptumHealth + "<p><a href=http://cms/USHealthServices/en/Reaping%20Rewards/Pages/Health_Assessment.aspx >Online Health Assessment Questionnaire</a></p> ";
            }


            // Stress Management

            if (Welcome.ReduceStressCHECKED == true)
            {
                ReduceStressIntroduction = "<h1>Stress</h1>";

                if (chk_OnSiteMassage.IsChecked == true)
                {
                    SMOnSiteMassageR = "<p><a href=http://teamspace/sites/CPreapreward/Lists/Announcements/DispForm.aspx?ID=21&Source=http%3A%2F%2Fteamspace%2Fsites%2FCPreapreward%2Fdefault%2Easpx >On-site Massage</a></p> ";
                }
                else
                {
                    SMOnSiteMassageR = "";
                }

                if (chk_StressToolBox.IsChecked == true)
                {
                    SMStressToolBoxR = "<p><a href=http://cms/sites/CPreapreward/Unrestricted_Documents/Employee%27s%20Stress%20Toolbox%20%2715.pdf >Stress Tool Box</a></p> ";
                }
                else
                {
                    SMStressToolBoxR = "";
                }

                if (chk_OptumHealthReferral.IsChecked == true)
                {
                    SMOptumHealthRefferalR = "<p><a href=http://www.liveandworkwell.com/ >Optum Health Referral (EAP)</a></p> ";
                }
                else
                {
                    SMOptumHealthRefferalR = "";
                }

                if (chk_ActiveHealthCoachingProgram.IsChecked == true)
                {
                    SMActiveHealthCoachingR = "<p><a href=http://www.myactivehealth.com/syngentabenefits >ActiveHealth Coaching Program</a></p> ";
                }
                else
                {
                    SMActiveHealthCoachingR = "";
                }

                if (chk_ActivityChallengesec.IsChecked == true)
                {
                    SMActivityChallengeR = "<p><a href=http://www.SyngentaWellbeing.com >Activity Challenge</a></p> ";
                }
                else
                {
                    SMActivityChallengeR = "";
                }

                if (chk_OnSiteFitnessOfferssec.IsChecked == true)
                {
                    SMOnsiteFitnessOffersR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Exercise%20options%20GSO%20'18.pdf >On-site Fitness Offers</a></p> ";
                }
                else
                {
                    SMOnsiteFitnessOffersR = "";
                }

                if (chk_MindfullnessVideo.IsChecked == true)
                {
                    SMMindfullnessVideoR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Mindfulness%20Video%20Links.pdf >Mindfulness videos</a></p> ";
                }
                else
                {
                    SMMindfullnessVideoR = "";
                }

                ReduceStressWelcomes = ReduceStressIntroduction + SMOnSiteMassageR + SMStressToolBoxR + SMOptumHealthRefferalR + SMActiveHealthCoachingR + SMActivityChallengeR + SMOnsiteFitnessOffersR + SMMindfullnessVideoR;
            }

            // Hydration
            if (Welcome.ImproveHydrationCHECKED == true)
            {
                ImproveHydrationIntroduction = "<h1>Hydration</h1>";

                if (chk_HydrationMobileApps.IsChecked == true)
                {
                    HYDmobileAppsR = "<p><a href=http://plantnannyapp.com/ >Mobile Apps</a></p> ";
                }
                else
                {
                    HYDmobileAppsR = "";
                }

                if (chk_HydraHealthChallenge.IsChecked == true)
                {
                    HYDHealthChallengeR = "<p><a href=http://www.SyngentaWellbeing.com >Activity Challenge</a></p> ";
                }
                else
                {
                    HYDHealthChallengeR = "";
                }
                if (chk_HydraGeneralHydrationInfo.IsChecked == true)
                {
                    HydGeneralHydraInfoR = "<p><a href=https://www.mayoclinic.org/healthy-lifestyle/nutrition-and-healthy-eating/in-depth/water/art-20044256 >General Hydration Information</a></p> ";
                }
                else
                {
                    HydGeneralHydraInfoR = "";
                }

                ImproveHydrationWelcomes = ImproveHydrationIntroduction + HYDmobileAppsR + HYDHealthChallengeR + HydGeneralHydraInfoR + "<p><a href=http://cms/USHealthServices/en/Reaping%20Rewards/Pages/Health_Assessment.aspx >Online Health Assessment Questionnaire</a></p> ";
            }

            //Physical Activity
            if (Welcome.ImproveStaminaCHECKED == true)
            {
                BeMoreActiveIntroduction = "<h1>Physical Activity</h1>";

                if (chk_BeMoreActivityChall.IsChecked == true)
                {
                    BMAActivityChallengeR = "<p><a href=http://www.SyngentaWellbeing.com  >Activity Challenge</a></p> ";
                }
                else
                {
                    BMAActivityChallengeR = "";
                }

                if (chk_BeMoreOnsiteFitness.IsChecked == true)
                {
                    BMAOnsiteFitnessOfferR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Exercise%20options%20GSO%20'18.pdf >On-site Fitness Offers</a></p> ";
                }
                else
                {
                    BMAOnsiteFitnessOfferR = "";
                }

                if (chk_BeMoreCropWalk.IsChecked == true)
                {
                    BMACropWalkR = "<p><a href=http://teamspace/sites/CPreapreward/_layouts/listform.aspx?PageType=4&ListId={E4D86A23-C8EA-4C3B-BF09-3BDE47F2457A}&ID=27&ContentTypeID=0x010400236AD8E4EAC83B4CBF093BDE47F2457A >CROP Walk</a></p> ";
                }
                else
                {
                    BMACropWalkR = "";
                }

                if (chk_BeMoreUpcomingActivity.IsChecked == true)
                {
                    BMAUpcomigActivityEventR = "<p><a href=http://www.SyngentaWellbeing.com >Upcoming Activity Events</a></p> ";
                }
                else
                {
                    BMAUpcomigActivityEventR = "";
                }
                BeMoreActiveWelcomes = BeMoreActiveIntroduction + BMAActivityChallengeR + BMACropWalkR + BMAOnsiteFitnessOfferR + BMAUpcomigActivityEventR;
            }

            //Finances
            if (Welcome.FinancialCHECKED == true)
            {
                FinancialIntroduction = "<h1>Finances</h1>";

                if (chk_FinancOptumHealthReff.IsChecked == true)
                {
                    FINOptumHealthRefferalR = "<p><a href=http://www.liveandworkwell.com/ >Optum Health Referral (EAP)</a></p> ";
                }
                else
                {
                    FINOptumHealthRefferalR = "";
                }

                if (chk_FinancTRowePrice.IsChecked == true)
                {
                    FINTLowePriceR = "<p><a href=http://www3.troweprice.com/rws/public/v/home.jsp >T. Rowe Price Benefits Page</a></p> ";
                }
                else
                {
                    FINTLowePriceR = "";
                }
                FinancialWelcomes = FinancialIntroduction + FINOptumHealthRefferalR + FINTLowePriceR;
            }

            //A Healthy You
            if (Welcome.AHealthyYouCHECKED == true)
            {
                AHealthyYouIntroduction = "<h1>A Healthy You</h1>";

                if (chk_AHealtOnsiteFluVacci.IsChecked == true)
                {
                    AHYOnSiteFluVaccineR = "<p><a href=http://www.SyngentaWellbeing.com >On-site Flu Vaccinations</a></p> ";
                }
                else
                {
                    AHYOnSiteFluVaccineR = "";
                }

                if (chk_AHealtOneononeHealth.IsChecked == true)
                {
                    AHYOneOnOneHealthCoachingR = "<p><a href=http://www.myactivehealth.com/syngentabenefits   >One-on-one Health Coaching</a></p> ";
                }
                else
                {
                    AHYOneOnOneHealthCoachingR = "";
                }

                if (chk_AHealtGenerHealthINFO.IsChecked == true)
                {
                    AHYGeneralHealthInfoR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Body%20Corn%20links%20'16.pdf >General Health Information</a></p> ";
                }
                else
                {
                    AHYGeneralHealthInfoR = "";
                }


                if (chk_AHealtUpcomHealthscree.IsChecked == true)
                {
                    AHYUpcomingHealthScreenR = "<p><a href=http://www.SyngentaWellbeing.com >Upcoming Health Screenings</a></p> ";
                }
                else
                {
                    AHYUpcomingHealthScreenR = "";
                }

                if (chk_AHealtOnlineHealthAsees.IsChecked == true)
                {
                    AHYOnlineHealthQuestionR = "<p><a href=http://cms/USHealthServices/en/Reaping%20Rewards/Pages/Health_Assessment.aspx >Online Health assessment questionnaire</a></p> ";
                }
                else
                {
                    AHYOnlineHealthQuestionR = "";
                }

                AHealthyYouWelcomes = AHealthyYouIntroduction + AHYOnSiteFluVaccineR + AHYOneOnOneHealthCoachingR + AHYGeneralHealthInfoR + AHYUpcomingHealthScreenR + AHYOnlineHealthQuestionR;
            }

            //Work/Life Balance
            if (Welcome.WorkLifeBalanceCHECKED == true)
            {
                WorkLifeBalanceIntroduction = "<h1>Work/Life Balance</h1>";

                if (chk_Work_LIStressToolBox.IsChecked == true)
                {
                    WLBStressToolBoxR = "<p><a href=http://cms/sites/CPreapreward/Unrestricted_Documents/Employee%27s%20Stress%20Toolbox%20%2715.pdf >Stress Tool Box</a></p> ";
                }
                else
                {
                    WLBStressToolBoxR = "";
                }

                if (chk_Work_LIJoinEmployee.IsChecked == true)
                {
                    WLBJoinEmployeeResourceGrpR = "<p><a href=http://teamspace/sites/NAERG/ERGs/default.aspx >Join Employee Resource Group (ERG)</a></p> ";
                }
                else
                {
                    WLBJoinEmployeeResourceGrpR = "";
                }

                if (chk_Work_LIReapingFacebookPage.IsChecked == true)
                {
                    WLBReapingRewardFacebookR = "<p><a href=https://www.facebook.com/groups/1446472828968954/>Reaping Rewards Facebook Page</a></p> ";
                }
                else
                {
                    WLBReapingRewardFacebookR = "";
                }

                if (chk_Work_LIGeneralHealthInfo.IsChecked == true)
                {
                    WLBGeneralHealthInfoR = "<p><a href=http://teamspace/sites/CPreapreward/Unrestricted_Documents/Body%20Corn%20links%20'16.pdf >General Health Information</a></p> ";
                }
                else
                {
                    WLBGeneralHealthInfoR = "";
                }
                WorkLifeBalanceWelcomes = WorkLifeBalanceIntroduction + WLBStressToolBoxR + WLBJoinEmployeeResourceGrpR + WLBReapingRewardFacebookR + WLBGeneralHealthInfoR;
            }


            string MessageBoxTitle   = "Alert";
            string MessageBoxContent = "You will not be able to edit your selections. Are you sure you want to finish?";

            MessageBoxResult dialogResult = MessageBox.Show(MessageBoxContent, MessageBoxTitle, MessageBoxButton.YesNo, MessageBoxImage.Error); //MessageBoxImage.Question, MessageBoxImage.Error);

            if (dialogResult == MessageBoxResult.Yes)
            {
                emailReal = txt_EmailIntermediate.Text;
                SecondPage ss = new SecondPage();
                ss.Show();
                this.Hide();
            }
            else if (dialogResult == MessageBoxResult.No)
            {
                return;
                //do something else
            }
        }