Example #1
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            if (isvalidated())
            {
                string month;
                int    amount = Convert.ToInt32(txtFee.Text);

                // code for months
                if (txtnewMonth.Text.Trim().Length == 0)
                {
                    month = cbxMonths.SelectedItem.ToString();
                }
                else
                {
                    month = txtnewMonth.Text.Trim().ToString();
                    if (!addNewMonth(month))
                    {
                        MessageBox.Show("New month is not added");
                    }
                }


                // code for dgv rows

                foreach (DataGridViewRow dgvRow in dgvStudents.Rows)
                {
                    if (dgvRow.Cells[0].Value != null && Convert.ToBoolean(dgvRow.Cells[0].Value))
                    {
                        int id = Convert.ToInt32(dgvRow.Cells[1].Value.ToString());
                        if (isPaid(Convert.ToInt32(dgvRow.Cells[1].Value), month))
                        {
                            if (Convert.ToBoolean(payStudentFee(id, month, amount)))
                            {
                                PrintSlipData.feeId        = id;
                                PrintSlipData.studentName  = dgvRow.Cells[2].Value.ToString();
                                PrintSlipData.fatherName   = dgvRow.Cells[3].Value.ToString();
                                PrintSlipData.studentClass = dgvRow.Cells[4].Value.ToString();
                                PrintSlipData.feeMonth     = month;
                                PrintSlipData.amount       = amount.ToString();

                                SlipForm cf = new SlipForm();
                                cf.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show("Some thing went wrong!");
                            }
                        }
                    }
                }
            }
        }
Example #2
0
        private void showslip()
        {
            SlipForm sf = new SlipForm();

            sf.ShowDialog();
        }
Example #3
0
        private void printSlip()
        {
            SlipForm sdf = new SlipForm();

            sdf.ShowDialog();
        }