private void button4_Click(object sender, EventArgs e) { if (txttenure.Text == "1") { b = Convert.ToInt32(txtijarahamount.Text); for (int j = 1; j <= 12; j++) { int newRowIndex = dataGridView1.Rows.Add(); int z = 12; markup = double.Parse(txtmarkup.Text); Double a = (b / 100) * 80; prfrate = (markup + 3.00) / 100.00; bnkprf = (a * prfrate * 31.00) / 365.00; rental = (a + bnkprf + 30000) / z; z--; string r = Convert.ToString(rental); dataGridView1.Rows[newRowIndex].Cells["Amount"].Value = r.ToString(); a = a - Convert.ToDouble(dataGridView1.Rows[newRowIndex].Cells["Amount"].Value); r = Convert.ToString(rental); dataGridView1.Rows[newRowIndex].Cells["Date"].Value = dateTimePicker1.Value.Date.AddMonths(j).ToString(); dataGridView1.Rows[newRowIndex].Cells["ijarah_id"].Value = txtijarahid.Text; }
if (txttenure.Text == "1")
if (int.TryParse(txttenure.Text, out b))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)