/// <summary> /// Constructor for addGoalForm. Takes in a model to get data relating to existing goals. /// </summary> /// <param name="model"> Perfection model</param> public addGoalForm(PerfectionModel model) { InitializeComponent(); _model = model; _submitted = false; _goalToAdd = null; }
/// <summary> /// Constructor for the removeGoalForm. Sets values and takes in a model. Populates the checkbox with the users goals. Sets submitted to false. /// </summary> /// <param name="model"></param> public removeGoalForm(PerfectionModel model) { InitializeComponent(); _model = model; _submitted = false; _remSolo = false; _goalsToRemove = new List<Goal>(); foreach (Goal g in _model.User.Goals) { goalChkBx.Items.Add(g); } }
/// <summary> /// completeGoalForm constructor. Takes in a model and sets default values. /// All goals already completed are added to locked completed goal list box. /// </summary> /// <param name="model">Perfection Model</param> public completeGoalForm(PerfectionModel model) { InitializeComponent(); _model = model; _submitted = false; taskCkhBx.Items.Clear(); shortChkBx.Items.Clear(); longChkBx.Items.Clear(); completedBx.Items.Clear(); _tasksToComplete = new List<TaskGoal>(); _shortToComplete = new List<ShortTermGoal>(); _longToComplete = new List<LongTermGoal>(); foreach (TaskGoal tg in _model.User.Tasks) { if (!tg.Completed) { taskCkhBx.Items.Add(tg); } } foreach (ShortTermGoal sg in _model.User.ShortGoals) { if (!sg.Completed) { shortChkBx.Items.Add(sg); } } foreach (LongTermGoal lg in _model.User.LongGoals) { if (!lg.Completed) { longChkBx.Items.Add(lg); } } foreach (Goal g in _model.User.Goals) { if (g.Completed) { completedBx.Items.Add(g); } } }
/// <summary> /// Default Constuctor, intializes the model. /// </summary> public PerfectionMain() { InitializeComponent(); model = new PerfectionModel(); }