Exemple #1
0
        private void btnThucHienTraDia_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("Xác nhận trả đĩa", "Trả đĩa", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    ThucHienTraDia();
                }
                var customer = new CustomerBUL().GetCustomer(Int32.Parse(txtMaKH.Text.ToString()));
                var lstLate  = new ListRentedBUL().ListLate(customer.IdCustomer);
                if (lstLate.Count > 0)
                {
                    DialogResult result1 = MessageBox.Show("Khách hàng có khoản trễ hạn. Có muốn thực hiện thanh toán không?", "Phí trễ hạn", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (result1 == DialogResult.Yes)
                    {
                        FormThanhToan frm = new FormThanhToan(customer, lstLate, this.auth);
                        frm.Show();
                        frm.FormClosing += Frm_FormClosing;
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Kiểm tra lại thông tin trả đĩa", "Trả đĩa", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void buttonThanhToan_Click(object sender, EventArgs e)
        {
            FormThanhToan ftt = new FormThanhToan();

            this.Hide();
            ftt.ShowDialog();
            this.Show();
        }
        private void btn_TimKiemKhachHang_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_MaKHNhapVao.CheckMa() == false)
                {
                    return;
                }
                int      customerId = Int32.Parse(txt_MaKHNhapVao.Text.ToString());
                Customer customer   = dbCus.GetCustomer(customerId);
                if (customer == null)
                {
                    MessageBox.Show("Không tìm thấy khách hàng", "Thông tin khách hàng", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    LoadDataCustomerToText(customer);
                    AddInfoListView();
                }

                var lstLate = new ListRentedBUL().ListLate(customer.IdCustomer);
                if (lstLate.Count > 0)
                {
                    DialogResult result = MessageBox.Show("Khách hàng có khoản trễ hạn. Có muốn thực hiện thanh toán không?", "Phí trễ hạn", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (result == DialogResult.Yes)
                    {
                        FormThanhToan frm = new FormThanhToan(customer, lstLate, this.auth);
                        frm.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }