private void dtg_hoadon_Click(object sender, EventArgs e)
 {
     try
     {
         int mahoadon          = (int)dtg_hoadon.CurrentRow.Cells[0].Value;
         DAOChiTietHoaDon cthd = new DAOChiTietHoaDon();
         DataTable        tb   = new DataTable();
         tb = cthd.getChiTietHoaDon(mahoadon);
         dtg_chitiet_hoa_don.DataSource = tb;
     }
     catch { }
 }
Example #2
0
        void loadChiTietHoaDon()
        {
            DAOTable         ban = new DAOTable();
            DAOHoaDon        hd  = new DAOHoaDon();
            DAOChiTietHoaDon ct  = new DAOChiTietHoaDon();

            if (ban.KTBanDangSD(Globals.Maban))
            {
                dtg_chitiet.DataSource         = ct.getChiTietHoaDon(Globals.Mahoadon);
                dtg_chitiet.AllowUserToAddRows = false;
                txt_tongtien.text = hd.getTongbill(Globals.Mahoadon).ToString();
            }
        }
Example #3
0
        private void Bt_Click(object sender, EventArgs e)
        {
            Button bt = sender as Button;
            object a  = bt.Tag;

            Globals.SetMaban(Convert.ToInt32(a));
            frmdatdonhang frm = new frmdatdonhang();
            DAOHoaDon     hd  = new DAOHoaDon();
            // kt xem ban co dang su dung hay ko
            DAOTable         ban = new DAOTable();
            DAOChiTietHoaDon ct  = new DAOChiTietHoaDon();

            if (ban.KTBanDangSD(Globals.Maban))
            {
                Globals.SetMahoadon(hd.getCurrentMahoadon(Globals.Maban));
                Globals.SetChiTietHoaDon(ct.getChiTietHoaDon(Globals.Mahoadon));
            }



            frm.Show();
            frm.FormClosed += Frm_FormClosed;
        }