Beispiel #1
0
 private void btnViewBillInfo_Click(object sender, EventArgs e)
 {
     if (dtgvReport.CurrentRow != null)
     {
         int            idBill = (int)dtgvReport.CurrentRow.Cells[0].Value;
         fReportToPrint f      = new fReportToPrint();
         f.ReportViewName = "BillDetail";
         f.IdBill         = idBill;
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show("Vui lòng chọn hàng xem hóa đơn", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #2
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     if (dtgvReport.CurrentRow != null)
     {
         // Hepler.ExportToPDF(dtgvReport);
         fReportToPrint f = new fReportToPrint();
         f.ReportViewName = "Bill";
         f.Checkin        = dateFrom.Value;
         f.Checkout       = dateTo.Value;
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show("Chưa có hóa đơn nào", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #3
0
        private void btnCheckOut_Click(object sender, EventArgs e)
        {
            string idHoaDon = txtMaHoaDon.Text;

            if (idHoaDon != "")
            {
                if (MessageBox.Show("Bạn có chắc chắn muốn thanh toán không", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    if (BillInfoDAO.Instance.GetListBillInfoByIdBillToLst(Int32.Parse(idHoaDon)).Count > 0)
                    {
                        float totalPrice = (float)Convert.ToDouble(txtThanhTien.Text.Split(' ')[0].Replace(".", ""));
                        if (BillDAO.Instance.CheckOut(Int32.Parse(idHoaDon), (int)nmDiscount.Value, totalPrice))
                        {
                            ResetData();
                            MessageBox.Show("Thanh toán thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            fReportToPrint f = new fReportToPrint();
                            f.ReportViewName = "BillDetail";
                            f.IdBill         = Int32.Parse(idHoaDon);
                            f.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("Thanh toán thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Ko thể thanh toán vì hóa đơn này chưa có món ăn", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            else
            {
                MessageBox.Show("Vui lòng chọn hàng để thanh toán", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }