public Popup_Workout_ListView(SetWorkout selectedExercise, bool paid, int newID, string newWorkout, string newExercise, string newWorkType, int newCount, bool eX_done, bool wK_done, bool isNew, bool xMonday, bool xTuesday, bool xWednesday, bool xThursday, bool xFriday, bool xSaturday, bool xSunday, string xTime, bool xScheduled, int xNotificationID, bool isActive) { InitializeComponent(); is_paid = paid; mWork = newWorkout; mWorkType = newWorkType; mMonday = xMonday; mTuesday = xTuesday; mWednesday = xWednesday; mThursday = xThursday; mFriday = xFriday; mSaturday = xSaturday; mSunday = xSunday; mTime = xTime; mScheduled = xScheduled; mNotificationID = xNotificationID; if (isActive == false) { start_workout_button.IsEnabled = false; start_workout_button.BackgroundColor = Color.LightGray; } else if (isActive == true) { start_workout_button.IsEnabled = true; } }
public Popup_Exercise_ListView(SetWorkout selectedExercise, bool paid, int mID, string mWork, string mExercise, string mWorkType, int mCount, bool isNew, string xTime, bool xScheduled, int xNotificationID) { InitializeComponent(); is_paid = paid; this.selectedEx = selectedExercise; mWork = selectedExercise.MyWorkout; myExercise = selectedExercise.Exercise; myCount = selectedExercise.Reps; myID = selectedExercise.Id; myWorkType = selectedExercise.WorkoutType; myWork = mWork; mTime = xTime; mSchedule = xScheduled; mNotificationID = xNotificationID; }
private void Workout_Selection_Clicked(object sender, EventArgs e) { SetWorkout setworkout = new SetWorkout() { Id = w_ID, MyWorkout = my_WorkoutEntry.Text, Exercise = w_Exercise, WorkoutType = w_choice_type, Reps = repInt, ExDone = false, WkDone = false, ExDone_count = 0, WkDone_count = 0, Checkmark = "small_round_nocheck.jpg", Monday = w_Monday, Tuesday = w_Tuesday, Wednesday = w_Wednesday, Thursday = w_Thursday, Friday = w_Friday, Saturday = w_Saturday, Sunday = w_Sunday, TimeIs = w_Time, IsScheduled = w_Scheduled, Notification_ID = w_NotificationID, Workout_Status = w_workoutStatus, VibrationOn = w_vibrateBool, WorkoutReady = true, }; w_Workout = my_WorkoutEntry.Text; //my_RepEntry.Text = mCount_string; //repInt = repInt = Convert.ToInt32(mCount_string); using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation)) { if (w_Workout == "") { w_Workout = null; } if (w_Workout != null && repInt != 0 && w_Exercise != null) { if (new_entry == true) { conn.CreateTable <SetWorkout>(); int rows = conn.Insert(setworkout); w_ID = 0; } else { conn.CreateTable <SetWorkout>(); int rows = conn.Update(setworkout); } //----------------------------------------------------- //PopupNavigation.Instance.PopAsync(true); App.Current.MainPage = new My_ExerciseList_Page(w_ID, w_Workout, w_Exercise, w_choice_type, repInt, w_Time, w_Scheduled, w_NotificationID, is_paid); PopupNavigation.Instance.PopAsync(); } if (repInt == 0 && w_Exercise == null && w_Workout == null) { error_message.Text = "Missing: Workout name, Exercise and Set count "; } if (repInt == 0 && w_Exercise == null && w_Workout != null) { error_message.Text = "Missing: Exercise and Set count "; } if (repInt != 0 && w_Exercise == null && w_Workout != null) { error_message.Text = "Missing: Exercise "; } if (repInt == 0 && w_Exercise != null && w_Workout != null) { error_message.Text = "Missing: Set count "; } if (repInt != 0 && w_Exercise != null && w_Workout == null) { error_message.Text = "Missing: Workout name"; } if (repInt == 0 && w_Exercise != null && w_Workout == null) { error_message.Text = "Missing: Workout name and Set count"; } if (repInt != 0 && w_Exercise == null && w_Workout == null) { error_message.Text = "Missing: Workout name and Exercise"; } } }