private void button2_Click(object sender, EventArgs e) { DietForm df = new DietForm(); df.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { errorMsg.Text = ""; if (LoginUserTableAdapter.checkLogin(loginUserTxtBox.Text, loginPassTxtBox.Text).Value == 1) { UserClass.firstTime = true; UserClass.Name = loginUserTxtBox.Text; UserClass.Password = loginPassTxtBox.Text; int n = int.Parse(LoginUserTableAdapter.GetFindUser(UserClass.Name, UserClass.Password).Rows[0][0].ToString()); if (int.Parse(LoginUserTableAdapter.GetCheckForUpdated(UserClass.Name, UserClass.Password).Rows[0]["BMI"].ToString()) != 0) { if (goalsTableAdapter1.getGoalsAndStatus(n, "Incomplete") < 1) { TrainningForm tf = new TrainningForm(); tf.Show(); this.Hide(); } else if (userRoutineTableAdapter1.checkRoutine(n) < 1) { RoutineMenu rm = new RoutineMenu(); rm.Show(); this.Hide(); } else if (userDietPlanTableAdapter1.checkDietPlan(n) < 1) { DietForm df = new DietForm(); df.Show(); this.Hide(); } else { FinalForm ff = new FinalForm(); UserClass.firstTime = false; ff.Show(); this.Hide(); } } else { PersonalData pd = new PersonalData(); pd.Show(); this.Hide(); } } else { errorMsg.Text = "Wrong Username or Password. \nPlease try again!"; } }