Esempio n. 1
0
        private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (Convert.ToInt32(comboBox1.SelectedValue) > 0)
            {
                string   _date = lc.getsubmissiondate(Convert.ToInt32(dataGridView1.SelectedCells[0].Value), Convert.ToInt32(comboBox1.SelectedValue));
                DateTime d1    = Convert.ToDateTime(_date);
                double   ans   = lc.forFine(d1);

                if (ans > 0)
                {
                    submissiondatetb.BackColor = Color.Red;
                    submissiondatetb.Text      = d1.ToShortDateString().ToString();
                    days = Convert.ToInt32(ans);
                    fine = lc.calculateFine(days);
                }
                else
                {
                    submissiondatetb.BackColor = Color.LightGreen;
                    submissiondatetb.Text      = d1.ToShortDateString().ToString();
                }
            }
        }