悠悠同学网www.uuclass.com nosound(); gotoxy(41,14); clreol(); } }while(!valid); }while(ch == 'Y'); } //***************************************************************** // CLASS NAME : HKEEP // FUNCTION NAME : DELETE_RECORD // DETAILS : IT DELETES THE RECORD IN THE HKEEP'S FILE // FOR THE GIVEN CODE //***************************************************************** void hkeep :: delete_record(int t_code) { fstream file; file.open(\:: binary | ios :: in); fstream temp; temp.open(\:: binary | ios: file.seekg(0,ios::beg); while(file.read((char *) this, sizeof(hkeep))) { if(code != t_code) temp.write((char *) this, sizeof(hkeep)); } file.close(); temp.close(); file.open(\:: binary | ios: t_code = 1; while(temp.read((char *)this,sizeof(hkeep))) { code = t_code; file.write((char *)this, sizeof(hkeep)); t_code++; } file.close(); temp.close(); } ut); ut); temp.open(\:: binary | ios::in); 悠悠同学网www.uuclass.com
//***************************************************************** // CLASS NAME : HKEEP // FUNCTION NAME : DELETION // DETAILS : IT GIVES THE CODE NO. TO DELETE THE // RECORD IN HKEEP'S FILE //***************************************************************** void hkeep :: deletion(void) { menu m; clrscr(); int valid; int t_code = 0, t; char t1_code[5], t2_code[5]; char ch; gotoxy(3,3); cout<<\Enter Order Serial No. of the record to be deleted \ gotoxy(3,4); cout<<\or Press
do { valid = 1; gotoxy(45,12); ch = getch(); ch = toupper(ch); if (ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(45,12); clreol(); } }while(! valid); if (ch == 'N') return; gotoxy(1,25); cout<<\ delete_record(t_code); clrscr(); gotoxy(1,14); cout<<\Deleted\\n\ m.line_hor(1,79,24,196); gotoxy(1,25); cout<<\any key to continue...\ getch(); return; } display_list(); gotoxy(1,25); clreol(); gotoxy(3,25); cout<<\Order Serial No. of the record or
//***************************************************************** void hkeep :: modify_record(int t_code) { menu m; int valid,modified = 0; char ch; m.line_hor(1,79,12,196); gotoxy(3,14); cout<<\Serial No.\ gotoxy(3,16); cout<<\ : \ gotoxy(3,17); cout<<\No. : \ gotoxy(3,18); cout<<\ : \ m.line_hor(1,79,23,196); gotoxy(13,16); cout<<\(y/n) : \ do { valid =1; gotoxy(28,16); ch = getche(); ch = toupper(ch); if (ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(45,12); clreol(); } } while(!valid); valid = 0; while(!valid && ch == 'Y') { modified = 1; valid = 1; gotoxy(13,16);clreol(); gotoxy(3,25); cout<<\THE NAME OF THE PERSON\ gotoxy(13,16);