You are on page 1of 1

dh.

lietkedhmoi();

fstream fileInput("donhang.txt", ios::in);


string line;
int i = 0;
donhang dsdh[100];
while(!fileInput.eof()){
dh.setMaDon(line.substr(0,10));
dh.setMaKH(line.substr(11,21));
dh.setNgay(line.substr(22,30));
dh.setTongTien(line.substr(31,line.length() - 2));
dh.setTrangThai(line.substr(line.length() - 1, line.length()));
}

for (i=0; i<100; i++){


if (dsdh[i].trangthai == 0){
cout << dsdh[i].madon << "; " << dsdh[i].makh << "; " <<
dsdh[i].ngay << "; " << dsdh[i].tongtien << endl;
}
}

cin >> ma_don_hang_can_thay_doi;


cin >> trang_thai_can_thay_doi;
for (i=0; i<100; i++){
if (dsdh[i].getMadon == ma_don_hang_can_thay_doi){
dsdh[i].setTrangThai(dsdh[i].getTrangthai() + 1);
}
}

You might also like