WFA_psychometric_chart.Form1_main.ShowOrHideForComfortZone C# (CSharp) Method

ShowOrHideForComfortZone() public method

public ShowOrHideForComfortZone ( ) : void
return void
        public void ShowOrHideForComfortZone()
        {
            /*
            Note : This flogShow has just opposite property it si correct 
            1 means on before the chart load and while loading but when already on we dont need to on it again
            when click again when the intial state is on it should be off so 1 triggers off because the state is ON previously
            we need to make it OFF
            and IF the state is OFF initially 0 makes it ON the next time it is clicked 
            it is little confusing but true
            */
            if (flagShow == 0)
            {
                //=================uncomment this is requred after========= //
                //It is dissabled so enable it
                enableToolStripMenuItem.Checked = true;
                flagShow = 1;
                //enable off flag
                //When enabled we need to show the comfort zone
                //First update the value and then enable or dissable
                string status = "enable";
                //===========================end===============================//


                //MessageBox.Show("Enable ");
                //default_comfort_zone_of_chart already contains the loaded value
                //default_comfort_zone_of_chart[0].
                if (default_comfort_zone_of_chart.Count > 0)
                {
                    update_comfort_zone_for_chart(default_comfort_zone_of_chart[0].chartid, default_comfort_zone_of_chart[0].comfortzoneid, status);
                    //After updating we need to load the values
                    //we need to clear the chart before loading.
                    ClearComfortZone(double.Parse(listchartComfortZoneInfoSingle[0].min_temp), double.Parse(listchartComfortZoneInfoSingle[0].max_temp), double.Parse(listchartComfortZoneInfoSingle[0].min_hum), double.Parse(listchartComfortZoneInfoSingle[0].max_hum));
                    LoadComfortZone(default_comfort_zone_of_chart[0].chartid);
                }
            }
            else
            {
                //================enable this if required=========
                enableToolStripMenuItem.Checked = false;
                flagShow = 0; //Enable on flag for next time
                //When dissable hide comfort zone
                string status = "disable";
                //==================end enable this if require============//
                //MessageBox.Show("disable ");
                //default_comfort_zone_of_chart already contains the loaded value
                //default_comfort_zone_of_chart[0].
                if (default_comfort_zone_of_chart.Count > 0)
                {
                    update_comfort_zone_for_chart(default_comfort_zone_of_chart[0].chartid, default_comfort_zone_of_chart[0].comfortzoneid, status);
                    //After updating we need to load the values
                    //We need to clear the chart first..
                    ClearComfortZone(double.Parse(listchartComfortZoneInfoSingle[0].min_temp), double.Parse(listchartComfortZoneInfoSingle[0].max_temp), double.Parse(listchartComfortZoneInfoSingle[0].min_hum), double.Parse(listchartComfortZoneInfoSingle[0].max_hum));
                  //  LoadComfortZone(default_comfort_zone_of_chart[0].chartid);
                }

            }

        }
Form1_main