示例#1
0
        private void btnInBienLai_Click(object sender, EventArgs e)
        {
            if (dgvDanhSachHocVien.SelectedRows.Count == 1)
            {
                if (txtHocPhi.Text != "")
                {
                    int    hp;
                    string mahv = dgvDanhSachHocVien.SelectedRows[0].Cells["MaHV"].Value.ToString();
                    try
                    {
                        // check định dạng convet học phí
                        hp = Convert.ToInt32(txtHocPhi.Text);

                        DataTable bl = BLL_BienLai.Instance.GetBienLai(mahv, hp);
                        // get dữ liệu table lên rpt
                        rptBienlai rptBL = new rptBienlai();
                        rptBL.SetDataSource(bl);
                        //get rpt vào from in
                        frmInBienLai f = new frmInBienLai();
                        f.crystalReportViewer1.ReportSource = rptBL;
                        f.ShowDialog();
                        // Thay đổi tình trạng nộp
                        BLL_BienLai.Instance.ChangeState(mahv);
                        string malop = ((CbbItem)cboChonLop.SelectedItem).value;
                        ShowDgv(malop, cboHienThiDS.SelectedItem.ToString(), txtHoTen.Text);
                    }
                    catch (FormatException ex)
                    {
                        MessageBox.Show("Nhập sai định dạng học phí", "In Biên Lai", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Nhập học phí", "In Biên Lai", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Chọn 1 học viên để in", "In Biên Lai", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void btnInBienLai_Click(object sender, EventArgs e)
        {
            frmInBienLai inbienlai = new frmInBienLai();

            inbienlai.ShowDialog();
        }