Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Chantier_addSiteInDatabase(Llist *linkedList, const char *f_name)
- {
- Llist tmpLinkedList;
- ChantierDataFile newItem;
- if (linkedList->PTL == -1)
- {
- printf("Base de donn‚es pleinne");
- warningColor();
- }
- else
- {
- Chantier_getInformation(linkedList, &newItem, f_name);
- // Si base de donnée vide
- if (linkedList->PTO == -1)
- {
- tmpLinkedList.PTO = linkedList->PTL;
- tmpLinkedList.PTL = newItem.offsetNextSite;
- newItem.offsetNextSite = -1;
- }
- else
- {
- // Copie de PTL et PTO
- tmpLinkedList = *linkedList;
- // Modifie le chainage dans le fichier pour insérer le nouveau chantier
- Chantier_makeInsertionLinkings(&tmpLinkedList, &newItem, f_name);
- }
- if (Chantier_saveSiteInDatabase(linkedList->PTL, &newItem, f_name))
- {
- if (Chantier_saveLlistInDatabase(&tmpLinkedList, f_name))
- {
- *linkedList = tmpLinkedList;
- system("CLS");
- system("COLOR A");
- printf("Chantier correctement ajout‚ … la base de donn‚es\n");
- }
- }
- }
- // Mise en pause
- _getch();
- system("COLOR 7");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement