/* * NAME * * Flag_Assess_Form::Flag_Assess_Form - the constructor for the form. * * SYNOPSIS * * Flag_Assess_Form(int response, string n_category); * * response --> the trading object to be opened. * n_category --> the amount of capital to apply. * * DESCRIPTION * * This function initializes the form to a stable state. It also assigns * key information to identify what kind of data needs to be pulled from the Flag Category class. * Finally, it populates the form with the questions needed to assess the flag color. */ public Flag_Assess_Form(int response, string n_category) { InitializeComponent(); category = n_category; flag_category = new Flag_Category(category); Populate_Form(response, flag_category); }
/* * NAME * * Help_Reader_Form::Generate_Form - creates the form and the objects * on the form so the flag can be evaluated. * * SYNOPSIS * * void Generate_Form(string button); * * button --> the button that the user selected from the main form. (EI, VS, PW, PI) * * DESCRIPTION * * When the user starts the flag evaluation process, they first select * their initial observation of the situation. This function accepts that response, and generates the * next form based off of it. It then evaluates the data and provides information on how * to handle that flag situation in the classroom. * */ private void Generate_Form(string button) { Flag_Assess_Form fa; do { //Inital assessment int response = Assess_Flag(); //1 = positive, 0 = neutral, -1 = negative, 100 = cancel //Generate form fa = new Flag_Assess_Form(response, button); fa.ShowDialog(); } while (fa.Result == "N/A"); List <string> list = new List <string>(); if (fa.Result != "N/A" && fa.Result != "Cancel") { list = new Flag_Category(fa.Result, button).Responses; string summary = ""; foreach (string s in list) { summary += s + Environment.NewLine; } MessageBox.Show(summary, fa.Result.ToUpper() + " FLAG"); } }
/* * NAME * * Flag_Assess_Form::Populate_Form - populates the form with checkboxes. * * SYNOPSIS * * void Populate_Form(int response, Flag_Category category); * * response --> whether the observations are positive, neutral, or negative. * category --> the button category (EI, VS, PW, PI). * * DESCRIPTION * * This function populates the form based on the user's inital evaluation of the situation * in front of them. Then, depending on the response, it calls functions to populate with * blue, green, yellow, orange, or red checkboxes. * */ private void Populate_Form(int response, Flag_Category category) { if (response == 1) { Populate_Blue(); Populate_Green(); Populate_Yellow(); } else if (response == 0) { Populate_Green(); Populate_Yellow(); Populate_Orange(); } else if (response == -1) { Populate_Yellow(); Populate_Orange(); Populate_Red(); } }