コード例 #1
0
ファイル: Form_main.cs プロジェクト: fil-dv/Letter_Generator
        private void Item_CheckStateChanged(object sender, EventArgs e)
        {
            try
            {
                CheckBox cb = sender as CheckBox;
                if (cb.CheckState == CheckState.Checked)
                {
                    if (cb.Text == "Сумма долга не мение (грн)")
                    {
                        _isConditionWithMinSumSelected = true;
                        if (textBox_summa.Text.Length < 1)
                        {
                            textBox_summa.Text = "300";
                        }
                    }

                    LetterManager.ChangeConditionUsing(cb.Name, true);
                }
                else
                {
                    if (cb.Text == "Сумма долга не мение (грн)")
                    {
                        _isConditionWithMinSumSelected = false;
                        if (textBox_summa.Text.Length < 1)
                        {
                            textBox_summa.Text = "0";
                        }
                    }
                    LetterManager.ChangeConditionUsing(cb.Name, false);
                }
                RefreshToolStripPin();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception from WinFormsFace.Form_main.Item_CheckStateChanged() " + ex.Message);
            }
        }