my code adds people it deletes people it can even search for people but can it edit people......nope!
well this is what i got so far: -
{
-
char name_val[30];
-
struct client_struct client_rec;
-
FILE * client_file;
-
clrscr();
-
-
gotoxy(10,5);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,7);
-
textcolor(15);
-
cprintf("Edit a Client");
-
gotoxy(10,9);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,23);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,13);
-
textcolor(15);
-
cprintf("Enter the Name of the Client Your Editing: ");
-
gotoxy(50,15);
-
gets(name_val);
-
client_file = fopen(CLIENTS, "rb+"); /*open .dat file*/
-
-
clrscr();
-
-
gotoxy(10,5);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,7);
-
textcolor(15);
-
cprintf("Edit the Clients Details");
-
gotoxy(10,9);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,37);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,9);
-
textcolor(15);
-
-
while(fread(&client_rec, sizeof(client_rec), 1, client_file))
-
{
-
if(strcmp(name_val,client_rec.name)==0)
-
{
-
printf("\n\n\n\t\tPlease Enter the Name of the Client: ");
-
fflush(stdin);
-
gets(client_rec.name);
-
printf("\n\t\tPlease Enter the Treatment for the Client: ");
-
printf("\n\t\tF = Full Body Massage,");
-
printf("\n\t\tB = Back Massage,");
-
printf("\n\t\tM = Manicure,");
-
printf("\n\t\tP = Pedicure,");
-
printf("\n\t\tD = Pamper Day: ");
-
client_rec.treatment = getche();
-
printf("\n\n\t\tPlease Enter the Time of the Appointment: ");
-
scanf("%f", &client_rec.time);
-
printf("\n\n\t\tPlease Enter the Day (1 = Monday, 2 = Tuesday etc): ");
-
scanf("%d", &client_rec.day);
-
printf("\n\n\t\tPlease Enter a Contact Number for the Client: ");
-
scanf("%f", &client_rec.contact);
-
}
-
}
-
textcolor(15);
-
fclose(client_file);
-
-
getch();
-
-
}
-
ive been told that i should use a do while loop
anyone got any ideas for this?
1 2017
my code adds people it deletes people it can even search for people but can it edit people......nope!
well this is what i got so far: -
{
-
char name_val[30];
-
struct client_struct client_rec;
-
FILE * client_file;
-
clrscr();
-
-
gotoxy(10,5);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,7);
-
textcolor(15);
-
cprintf("Edit a Client");
-
gotoxy(10,9);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,23);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,13);
-
textcolor(15);
-
cprintf("Enter the Name of the Client Your Editing: ");
-
gotoxy(50,15);
-
gets(name_val);
-
client_file = fopen(CLIENTS, "rb+"); /*open .dat file*/
-
-
clrscr();
-
-
gotoxy(10,5);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,7);
-
textcolor(15);
-
cprintf("Edit the Clients Details");
-
gotoxy(10,9);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,37);
-
textcolor(1);
-
cprintf("-------------------------------------------------");
-
gotoxy(10,9);
-
textcolor(15);
-
-
while(fread(&client_rec, sizeof(client_rec), 1, client_file))
-
{
-
if(strcmp(name_val,client_rec.name)==0)
-
{
-
printf("\n\n\n\t\tPlease Enter the Name of the Client: ");
-
fflush(stdin);
-
gets(client_rec.name);
-
printf("\n\t\tPlease Enter the Treatment for the Client: ");
-
printf("\n\t\tF = Full Body Massage,");
-
printf("\n\t\tB = Back Massage,");
-
printf("\n\t\tM = Manicure,");
-
printf("\n\t\tP = Pedicure,");
-
printf("\n\t\tD = Pamper Day: ");
-
client_rec.treatment = getche();
-
printf("\n\n\t\tPlease Enter the Time of the Appointment: ");
-
scanf("%f", &client_rec.time);
-
printf("\n\n\t\tPlease Enter the Day (1 = Monday, 2 = Tuesday etc): ");
-
scanf("%d", &client_rec.day);
-
printf("\n\n\t\tPlease Enter a Contact Number for the Client: ");
-
scanf("%f", &client_rec.contact);
-
}
-
}
-
textcolor(15);
-
fclose(client_file);
-
-
getch();
-
-
}
-
ive been told that i should use a do while loop
anyone got any ideas for this?
I would agree with using a while loop, I would also suggest getting rid of getch() , but that's a personal issue - several compilers are ok with it...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Gilles T. |
last post by:
How I can get element ID in the edit mode of datagrid control?
If I not in the edit mode, there are no problem.
<asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3"...
|
by: Javier Gomez |
last post by:
I have a query field which is a non editable field because is a
function's result.
Due to I need to edit the information, Can you please suggest me any
solution for this problem??
(No matter...
|
by: ritchie |
last post by:
Hi,
I am writing for some help with editing a linked list.
I would be gratful if anybody has the time to take a look at this.
I am trying to edit a node by entering a date as a key.
If an...
|
by: Glenn M |
last post by:
I have a shared XML file on a server .
i also have one xslt file that performs a simple transform on in to
view the data.
now i want to have another page that lets users modify the shared xml...
|
by: Schultz |
last post by:
is there an easy to follow, source code in one document, article that
explains how to create an edit all DataGrid control?
and, I have a DataGrid setup where the client enters information for...
|
by: nate axtell |
last post by:
In VB .Net I made a custom CheckBox column style (for the Datagrid control) that maps to two DataTable columns , one it uses for the Checked status and the other it uses for the Enabled status. I am...
|
by: pradeeba31 |
last post by:
i was given a task in which i have to do the ui part using MFC.
im having three editboxes. i used setfocus function for these edit(text boxes). when the user focus this text box it should do some...
|
by: Kosmös Pollard |
last post by:
Hey guys, I'm rather new to access and can not seem to figure out what
is wrong with this code I will post below...but first...it was working
perfectly fine before I added this:
recSet2.Edit...
|
by: Benny Ng |
last post by:
Dear All,
Now I met one problem in the development of my one application.
I have one ASP.NET page. It's for disply the information of customer.
But now I have one new requirement. It's to...
|
by: tristanlbailey |
last post by:
I been scouring the Internet for an answer to my problem, and a couple of times thought I had almost found the answer, but still to no avail.
I'm tying to use the Rich Edit class (riched20.dll),...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |