Beispiel #1
0
        private void Hienthi()
        {
            int idDh = (int)grViewDH.GetFocusedRowCellValue("ID");

            dh = dhDAO.GetDHById(idDh);
            List <CHITIETDONHANG>    lstCTDH = dhDAO.GetCTDH(dh.ID);
            List <THONGTINCHITIETDH> lstTTCT = new List <THONGTINCHITIETDH>();

            foreach (CHITIETDONHANG c in lstCTDH)
            {
                SANPHAM           s = new SanphamDAO().getSanphamById(c.SANPHAM_ID);
                THONGTINCHITIETDH t = new THONGTINCHITIETDH(c, s);
                lstTTCT.Add(t);
            }
            grCtrlCTDH.DataSource = lstTTCT;
            txtNgaydat.Text       = ((DateTime)dh.NGAYDAT).ToShortDateString();
            txtKH.Text            = dhDAO.GetTenKH(dh.ID);
            txtDC.Text            = dh.DIACHI;
            txtNguoinhan.Text     = dh.TENNGUOINHAN;
            txtSDT.Text           = dh.SDT;
            txtTong.Text          = dh.TONGTIEN.ToString();
            txtTrangthai.Text     = dhDAO.GetTTbyId(dh.TRANGTHAI_ID).TEN;
        }