Page

Railway Ticket Reservation System In C,C++

#include<iostream.h>
#include<stdio.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
int rep;
int i;
int ia=12,sa=13,isa=5;
float am=0;
class reser
{
public:

char nam[20][10], add[30][30];
int rep;
int i;
float cost[10];
int choice[10];


void menu();
void calculation();
void choicetable();
void output();
void total();

}res;

void reser:: menu()
{
clrscr();
cout<<"*********************************Menu List*************************************" ;
cout<<"\n\nS.No.  Name \t\t No of Seats \t Cost per Seat \t From \t To\n";
cout<<"\n\n1.  Punjab Male \t "<<ia<<" \t\t Rs 1000 \t Delhi \t Jaipur\n";
cout<<"\n2.  Jan Shatabdi \t "<<sa<<" \t\t Rs 1200 \t Delhi \t Agra\n";
cout<<"\n3.  Shatabdi Express \t "<<isa<<" \t\t Rs 900 \t Agra \t Jaipur\n";
cout<<"\n4.  Exit";
cout<<"\n\n*******************************************************************************" ;

}

void reser:: calculation()
{
first:
cout<<"\nEnter the S.No. from the Menu List\n";
cin>>res.choice[i];
switch(res.choice[i])
{
case 1:
if(ia==0)
{
cout<<"Sorry No Seat avialable";
}
else
{
cout<<"You HAve Choose 1.  Punjab Male From-Delhi To-Jaipur";
ia--;
res.cost[i]=1000 ;
}
break;

case 2:
if(sa==0)
{
cout<<"Sorry No Seat avialable";
}
else
{
cout<<"\nYou HAve Choose \n2.  Jan Shatabdi From-Delhi To-Agra";
sa--;
res.cost[i]=1200;
}
break;

case 3:
if(isa==0)
{
cout<<"\nSorry No Seat avialable";
}
else
{
cout<<"You HAve Choose \n3.  Shatabdi Express From-Agra To-Jaipur";
isa--;
res.cost[i]=900;
}
break;

case 4:
return ;

default:
cout<<"\nWrong Choice\nPlease re-enter Your choice";
getch() ;
goto first;

}

cout<<"\n\nDo u Want to confirm it y/n      ";
char con;
con=getche();
if( con=='n' || con=='N')
{
getch();
if(res.choice[i]==1)
 { ia++; }
if(res.choice[i]==2)
{ sa++;  }
if(choice[i]==3)
{ isa++; }
}

}
void reser:: choicetable()
{
if(res.choice[i]== 1)
{
cout<<"\nPunjab MAle \t Delhi to \t Jaipur\t \n \t\t\tRs 1000 \n";
}
if(res.choice[i]== 2)
{
cout<<"\nJan Shatabdi \t Delhi to \t Agra\t \n \t\t\tRs 1200 \n";
}
if(res.choice[i]== 3)
{
cout<<"\nShatabdi Express \t Agra to \t Jaipur\t \n \t\t\tRs 900 \n";
}
}



void reser:: output()
{
puts(res.nam[i]);
cout<<"\n";
puts(res.add[i]);
res.choicetable();

}

void reser:: total()
{

am=am+res.cost[i];
}

void main()
{
clrscr();
cout<<"\t\t\tRailway Ticket Reservation System\n\n\n\n\n\n";
cout<<"\n\n\tDevelop By-\n \nsourcecodernp.blogspot.com\n";

delay(5000);
clrscr();
gotoxy(22,0);
cout<<"\t\t\t\tLoading Completed";
delay(300);
int l;
int b=219;

 int v1=10, v2=35;
 char lod[10][25]={"CUI",
"Database",
"Opening File",
"Retriving Data",
"Starting notepad",
"Prearing The interface",
"Allocating seats",
"Connecting",
"Connecting With Database",
"Completing",
};
gotoxy(30,30);
 cout<<"\n_______________________________________________________________________________\n";
 cout<<"\t\t\t\tFiles loading";
 cout<<"\n_______________________________________________________________________________\n";

 for(int i=0;i<10;i++)
{
gotoxy(0,0);
      gotoxy(50,1);
      printf("%d  \%",i*10);
gotoxy(0,0);
gotoxy(v1,10);
printf("%c%c",b,b);
printf("%c%c",b,b);
printf("%c%c",b,b);
v1=v1+6;
delay(900);
gotoxy(0,0);
gotoxy(32,v2);

puts(lod[i]);

v2++;
}

       /* for(l=0;l<=10;l++)
{      gotoxy(v,10);
      printf("%c%c%c",b,b,b);
     delay(200);
      v++;
      gotoxy(0,vy);
      puts(pnt[i]);
      delay(200);
      vy++;
      cout<<"\n";
}*/
delay(5000);
clrscr();
cout<<"\n\n\n\n\n\n\nLoading Completed";
delay(2000);
clrscr();
cout<<"\n\n\n\n\nWelcome to The Railway Ticket Reservation System\t\t\n\n Powered By sourcecodernp.blogspot.com";
delay(2000);
clrscr();
start:
cout<<"\nEnter the number of seats u want to book";
gotoxy(35,12);
printf("0=Exit");
gotoxy(4,5);
cout<<"\n";
cin>>rep;
cout<<"\n\n\n\nYou have entered the choice\n %d"<<rep;
clrscr();
if(rep>0 && rep<=10)
{
for(i=0  ; i<rep; i++)
{
cout<<"\nEnter Your Name\t";
fflush(stdin);
gets(res.nam[i]);
cout<<"\nEnter Your Personal Address\t";
gets(res.add[i]);
res.menu();
res.calculation();
if(i<rep-1)
{
cout<<"\n\nPress any key to input next entery";
}
else if(i==rep-1)
{
cout<<"\n\nPress any key to input last  entery";
}
getch();
clrscr();
res.total();
}
for(i=1  ; i<=rep; i++)
{
res.output();
}

cout<<"\nTotal Amount is %f"<<am;

}
else if(rep>10||rep<0)
{
cout<<"You have entered either 0 or negative or greater than 10\n";
goto start;
}
if(rep==0)
 {
  return;
 }
clrscr();
cout<<"Please Wait wile Calculating";
delay(1000);
cout<<".";
delay(1000);
cout<<".";
delay(1000);
cout<<".";
delay(1000);
cout<<".";
delay(2000);
cout<<".";
clrscr();
cout<<"\n\n*******************************************************************************" ;
cout<<"\t\t\t List of Ticket You Have booked\n";
cout<<"\n\n*******************************************************************************\n\n" ;

cout<<"\n\n_________________________________________________________________________________\n\n" ;
for(i=1  ; i<=rep; i++)
{
res.output();
cout<<"\n_________________________________________________________________________________\n\n" ;
}
cout<<"Press any key to calculate sum of amount to be paid";
getch();
clrscr();
cout<<"\nCalculating Your Total Amount to be Paid";
delay(2000);
clrscr();
  cout<<"\nTotal Amount is ";
  cout<<"\n\n\n\n\n\n\t\t\t\tPlease pay \t"<<am;
  float pay, amm;
  cout<<"\n\n\n\t\t";
  getch();
 /* cin>>pay;
  float out;
  out=am-pay;
  while(am!=pay)
  {
if(pay>am)
{
cout<<"PLease Collect the change  "<<(pay-am);
}
if(pay<am)
{
cout<<"Please pay  "<<out<<" amount";
cin>>out;
while((pay-out)!=0)

}
  }   */
clrscr();
  cout<<"\n\n\n\t\tThanks Please wisit Again";
  getch();

}


Petrol Filling Management System In C,C++

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
double diesel_cost;
double petrol_cost;
double naturalgas_cost;
double litre;
double service_cost;
double total_cost_diesel;
double total_cost_petrol;
double total_cost_naturalgas;
double total_petrol;
double total_diesel;
double total_naturalgas;
double total_amountp;
double total_amountd;
int choice;
cout<<"\n\t\t\t Welcome to Bharat Petroleum";
cout<<"\n Total amount of petrol received by the seller:";
cin>>total_petrol;
cout<<"\n Total amount of diesel received by the seller:";
cin>>total_diesel;
cout<<"\n Total amount of natural gas received by seller:";
cin>>total_naturalgas;
cout<<"\n Cost of diesel per litre:";
cin>>diesel_cost;
cout<<"\n Cost of petrol per litre:";
cin>>petrol_cost;
cout<<"\n Cost of natural gas per litre:";
cin>>naturalgas_cost;
cout<<"\n Cost of service of vehicle:";
cin>>service_cost;
cout<<"\n\n\n\tWelcome to Bharat petroleum";
cout<<"\n\n Total amount of petrol received by the seller:";
cout<<total_petrol;
cout<<"\n\n Total amount of diesel received by the seller:";
cout<<total_diesel;
cout<<"\n\n Total amount of natural gas recieved by the seller:";
cout<<total_naturalgas;
cout<<"\n\n Cost of diesel per litre is:";
cout<<diesel_cost;
cout<<"\n\n Cost of petrol per litre is:";
cout<<petrol_cost;
cout<<"\n\n Cost of natural gas per litre is:";
cout<<naturalgas_cost;
cout<<"\n\n Cost of service of vehicle is:";
cout<<service_cost;
cout<<"\n\n you have following choices :\n\t 1.Petrol \n\t 2.Diesel \n\t 3.Natural gas\n\t 4.Service of vehicle\n\tenter your choice:";
cin>>choice;
switch(choice)
{
case 1:
cout<<"\n\n Quantity of petrol filled: ";
cin>>litre;
total_cost_petrol=litre*petrol_cost;
cout<<"\n\n Total cost of petrol filled:";
cout<<total_cost_petrol;
break;
case 2:
cout<<"\n\n Quantity of diesel filled:";
cin>>litre;
total_cost_diesel=litre*diesel_cost;
cout<<"\n\n Total cost of diesel filled:";
cout<<total_cost_diesel;
break;
case 3:
cout<<"\n\n Quantity of natural gas filled:";
cin>>litre;
total_cost_naturalgas=litre*naturalgas_cost;
cout<<"\n\n Total cost of natural gas filled:";
cout<<total_cost_naturalgas;
break;
case 4:
cout<<"\n\n Service cost of vehicle:";
cout<<service_cost;
break;
}

cout<<endl;
cout<<"PROGRAMMING DESIGNED BY :"<<endl;
cout<<"sourcecodernp.blogspot.com"<<endl;

getch();
}

Laboratory Management System in C,C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
struct lab
 {
   char name[20];
   char sex;
   char add[50];
   long int mob;
   int id;
   int age;
   int tsh,t4,t3,cbc,tlc,dlc;
   int rbc,wbc,plat,hemo,hemoto;
   int neutro,lymo,baso,eosino,mono,poly;
 }l;
  class lab_mgt
   {
     public:
     void insert();
     void gen();
     void mainmenu();
//     void quit();
    };
    void lab_mgt::mainmenu()
    {
      int  ch;
      clrscr();
      cout<<"----------------------------------------------------------------";
      cout<<"\n \t\t LABAROTORY MANAGEMENT SYSTEM";
      cout<<"\n";
      cout<<"----------------------------------------------------------------";

      cout<<"\n\n\n\n\t 1. Insert a new record";
      cout<<"\n\n\t 2. Generate Report";
      cout<<"\n\n\t 3. Exit";
      cout<<"\n\n\n\t ENTER YOUR CHOICE= ";
      cin>>ch;
      clrscr();

      switch(ch)
      {
       case 1:
       insert();
       break;
       case 2:
       gen();
       break;
       case 3:
       exit(0);
       break;
       default:
       cout<<"\n Input correct choice=";
       getch();
       mainmenu();
       //break;
      }
    }
    void lab_mgt::insert()
    {
      int a;
      clrscr();
      cout<<"\n SELECT TEST IN THE LIST";
      cout<<"\n\n\n1. TSH TEST";
      cout<<"\n\n2. T4 TEST";
      cout<<"\n\n3. T3 TEST";
      cout<<"\n\n4. CBC TEST";
      cout<<"\n\n5. TLC TEST";
      cout<<"\n\n6. DLC TEST";
      cout <<"\n\n\n ENTER YOUR CHOICE:";
      cin>>a;
      clrscr();
      switch(a)
      {
       case 1:
       {
       FILE *fp;
       fp=fopen("tsh.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT TSH TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
       cin>>l.mob;

       cout<<"\n Input TSH=";
       cin>>l.tsh;
       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();
     mainmenu();
      break;
     }

     case 2:
       {
       FILE *fp;
       fp=fopen("t4.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT T4 TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       fflush(stdin);
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
fflush(stdin);
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
fflush(stdin);
       cin>>l.mob;
       cout<<"\n Input T4=";
fflush(stdin);
       cin>>l.t4;
       cout<<"\n Input TSH=";
fflush(stdin);
       cin>>l.tsh;

       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();
     mainmenu();
      break;
     }
     case 3:
       {
       FILE *fp;
       fp=fopen("t3.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT T3 TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
       cin>>l.mob;
       cout<<"\n Input T3=";
       cin>>l.t3;

       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();

     mainmenu();
      break;
     }
     case 4:
       {
       FILE *fp;
       fp=fopen("cbc.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT CBC TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
       cin>>l.mob;
       cout<<"\n Input RBC=";
       cin>>l.rbc;
       cout<<"\n Input WBC=";
       cin>>l.wbc;
       cout<<"\n Input PLATLETS=";
       cin>>l.plat;
       cout<<"\n Input HEMOGLOBIN=";
       cin>>l.hemo;
       cout<<"\n Input HEMOTOCRIT=";
       cin>>l.hemoto;

       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();
     mainmenu();
      break;
     }
     case 5:
       {
       FILE *fp;
       fp=fopen("tlc.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT TLC TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
       fflush(stdin);
       cin>>l.mob;
       cout<<"\n Input WBC=";
       fflush(stdin);
       cin>>l.wbc;
       cout<<"\n Input NEUTROPHILS=";
       fflush(stdin);
       cin>>l.neutro;
       cout<<"\n Input LYMOCYTES=";
       fflush(stdin);
       cin>>l.lymo;

       cout<<"\n Input BASOPHILS=";
       fflush(stdin);
       cin>>l.baso;
       cout<<"\n Input EOSINOPHILS=";
       fflush(stdin);
       cin>>l.eosino;
       cout<<"\n Input MONOCYTES=";
       fflush(stdin);
       cin>>l.mono;
       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();
     mainmenu();
     break;
     }
     case 6:
       {
       FILE *fp;
       fp=fopen("dlc.txt","a");
       if(fp!=NULL)
       {
       cout<<"\n YOU SELECT DLC TEST";
       cout<<"\n\n Input Patient Id=";
       cin>>l.id;
       cout<<"\n Input Name of Patient=";
       fflush(stdin);
       gets(l.name);
       cout<<"\n Input Age=";
       fflush(stdin);
       cin>>l.age;
       cout<<"\n Input Sex [M/F]=";
       fflush(stdin);
       cin>>l.sex;
       cout<<"\n Input Address=";
       fflush(stdin);
       gets(l.add);
       cout<<"\n Input Mobile No.=";
       cin>>l.mob;
       cout<<"\n Input POLYMORPHS=";
       fflush(stdin);
       cin>>l.poly;
cout<<"\n Input LYMOCYTES=";
fflush(stdin);
       cin>>l.lymo;

 cout<<"\n Input BASOPHILS=";
 fflush(stdin);
       cin>>l.baso;
 cout<<"\n Input EOSINOPHILS=";
 fflush(stdin);
       cin>>l.eosino;
 cout<<"\n Input MONOCYTES="; fflush(stdin);
       cin>>l.mono;

       fwrite(&l,sizeof(l),1,fp);
       }
       else
       {
cout<<"\n Error In opening File";
       }
       fclose(fp);
     getch();
     mainmenu();
      break;
     }

   default:
   cout<<"\n input correct choice=";
   getch();
   mainmenu();
  }
  }
  void lab_mgt::gen()
  {
      int a;
      clrscr();
      cout<<"\n SELECT TEST IN THE LIST";
      cout<<"\n\n\n1. TSH TEST";
      cout<<"\n\n2. T4 TEST";
      cout<<"\n\n3. T3 TEST";
      cout<<"\n\n4. CBC TEST";
      cout<<"\n\n5. TLC TEST";
      cout<<"\n\n6. DLC TEST";
      cout<<"\n\n\n ENTER YOUR CHOICE:";
      cin>>a;
      clrscr();
      switch(a)
      {
       case 1:
{
  int ch;
    cout<<"\n      ******************************************************";
    cout<<"\n\t \t\tSONI LABORATARIES";
    cout<<"\n      ******************************************************";
  cout<<"\n\n\t\t\tREPORT GENERATE";
  cout<<"\n\t\t\t---------------";
   cout<<"\n\n\nInput Patient Id=";
  // fflush(stdin);
   cin>>ch;
   FILE *fp;
   fp=fopen("tsh.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(ch==l.id)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE= "<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE= "<<l.mob;
cout<<"\n\n\t PATIENT TSH= "<<l.tsh;
if(l.tsh<0.3)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t\tYOU HAVE HYPERTHYRIOD";
cout<<"\n\t\t-------------------------------------------------";
}
if(l.tsh>=3)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t YOU HAVE HYPOTHYRIOD";
cout<<"\n\t\t-------------------------------------------------";
}
if(l.tsh>0.3 && l.tsh<3)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t YOU ARE NORMAL";
cout<<"\n\t\t-------------------------------------------------";
 }
getch();
mainmenu();
}

      }
      fclose(fp);

 break;
 }
      case 2:
{
  int ch;
cout<<"\n      ******************************************************";
cout<<"\n\t \t\tSONI LABORATARIES";
cout<<"\n      ******************************************************";
cout<<"\n\n\t\t\tREPORT GENERATE";
cout<<"\n\t\t\t---------------";
cout<<"\n\n\n Input Patient Id=";
cin>>ch;
   FILE *fp;
   fp=fopen("t4.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(l.id==ch)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE= "<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE ="<<l.mob;
cout<<"\n\n\t PATIENT TSH ="<<l.tsh;
cout<<"\n\n\t PATIENT T4= "<<l.t4;

if(l.t4<4.5 && l.tsh>=3)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t\tYOU HAVE HYPOTHYRIODISM";
cout<<"\n\t\t-------------------------------------------------";

}
if(l.t4<4.5 &&l.tsh<0.3)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\tYOU HAVE PITUITARY PROBLEM";
cout<<"\n\t\t-------------------------------------------------";

}
if(l.t4>4.5 && l.t4<12.5)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t\tYOU ARE NORMAL";
cout<<"\n\t\t-------------------------------------------------";


 }

getch();
mainmenu();
}
      }
      fclose(fp);

 break;
 }
      case 3:
{
  int ch;
cout<<"\n      ******************************************************";
cout<<"\n\t \t\tSONI LABORATARIES";
cout<<"\n      ******************************************************";
cout<<"\n\n\t\t\tREPORT GENERATE";
cout<<"\n\t\t\t---------------";
cout<<"\n\n\n Input Patient Id=";
cin>>ch;
   FILE *fp;
   fp=fopen("t3.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(l.id==ch)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE= "<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE= "<<l.mob;
cout<<"\n\n\t PATIENT T3= "<<l.t3;
if(l.t3<=80)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\tYOU HAVE HYPOTHYRIODISM";
cout<<"\n\t\t-------------------------------------------------";


}
if(l.t4>=220)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\tYOU HAVE PITUITARY PROBLEM";
cout<<"\n\t\t-------------------------------------------------";


}
if(l.t3>80 && l.t3<220)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t\tYOU ARE NORMAL";
cout<<"\n\t\t-------------------------------------------------";
 }
getch();
mainmenu();
}
      }
      fclose(fp);

 break;
 }
      case 4:
{
  int ch;
cout<<"\n      ******************************************************";
cout<<"\n\t \t\tSONI LABORATARIES";
cout<<"\n      ******************************************************";
cout<<"\n\n\t\t\tREPORT GENERATE";
cout<<"\n\t\t\t---------------";
cout<<"\n\n\n Input Patient Id=";
cin>>ch;

   FILE *fp;
   fp=fopen("cbc.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(l.id==ch)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE="<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE ="<<l.mob;
cout<<"\n\n\t PATIENT RBC= "<<l.rbc;
cout<<"\n\n\t PATIENT WBC= "<<l.wbc;
cout<<"\n\n\t PATIENT PLATLATES= "<<l.plat;
cout<<"\n\n\t PATIENT HEMOGLOBIN= "<<l.hemo;
cout<<"\n\n\t PATIENT HEMOTOCRIT= "<<l.hemoto;
long int s=150000;
if(l.hemo<13 && l.plat<s && l.wbc<4300)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\tYOU HAVE LESS BLOOD";
cout<<"\n\t\t-------------------------------------------------";


}
if(l.hemo>=13 && l.plat>=s && l.wbc>=4300)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\t\t\t\tYOU ARE NORMAL";
cout<<"\n\t\t-------------------------------------------------";
}
getch();
mainmenu();
}
      }
      fclose(fp);

 break;
 }
      case 5:
{
  int ch;
cout<<"\n      ******************************************************";
cout<<"\n\t \t\tSONI LABORATARIES";
cout<<"\n      ******************************************************";
cout<<"\n\n\t\t\tREPORT GENERATE";
cout<<"\n\t\t\t---------------";
cout<<"\n\n\n Input Patient Id=";
cin>>ch;

   FILE *fp;
   fp=fopen("tlc.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(l.id==ch)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE= "<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE= "<<l.mob;
cout<<"\n\n\t PATIENT WBC= "<<l.wbc;
cout<<"\n\n\t PATIENT NEUTROPHILS= "<<l.neutro;
cout<<"\n\n\t PATIENT LYMPHOCYTES= "<<l.lymo;
cout<<"\n\n\t PATIENT BASOPHILS= "<<l.baso;
cout<<"\n\n\t PATIENT EOSINOPHILS= "<<l.eosino;
cout<<"\n\n\t PATIENT MONOCYTES= "<<l.mono;
if(l.wbc>30000)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\n\t\tYOU HAVE INFECTION OR ALLERGY OR LEUKEMIA";
cout<<"\n\t\t-------------------------------------------------";


}
getch();
mainmenu();
}
      }
      fclose(fp);

 break;
 }
      case 6:
{
  int ch;
cout<<"\n      ******************************************************";
cout<<"\n\t \t\tSONI LABORATARIES";
cout<<"\n      ******************************************************";
cout<<"\n\n\t\t\tREPORT GENERATE";
cout<<"\n\t\t\t---------------";
cout<<"\n\n\n Input Patient Id=";
cin>>ch;

   FILE *fp;
   fp=fopen("dlc.txt","r");
   rewind(fp);
   while(fread(&l,sizeof(l),1,fp)==1)
      {
       if(l.id==ch)
{
cout<<"\n\n\t PATIENT ID= "<<l.id;
cout<<"\n\n\t PATIENT NAME= "<<l.name;
cout<<"\n\n\t PATIENT AGE= "<<l.age;
cout<<"\n\n\t PATIENT SEX= "<<l.sex;
cout<<"\n\n\t PATIENT ADDRESS= "<<l.add;
cout<<"\n\n\t PATIENT MOBILE= "<<l.mob;
cout<<"\n\n\t PATIENT POLYMORPHS= "<<l.poly;
 cout<<"\n\n\t PATIENT LYMPHOCYTES= "<<l.lymo;
cout<<"\n\n\t PATIENT BASOPHILS= "<<l.baso;
cout<<"\n\n\t PATIENT EOSINOPHILS= "<<l.eosino;
cout<<"\n\n\t PATIENT MONOCYTES= "<<l.mono;

if(l.poly<40)
{
cout<<"\n\n\t\t-------------------------------------------------";
cout<<"\n\n\t\t\tYOU HAVE LOW BLOOD CELLS";
cout<<"\n\t\t-------------------------------------------------";

}
getch();
mainmenu();
}
      }
      fclose(fp);
 break;
 }
default:
cout<<"\n\n\nyou enter wrong choice";
}
}

 void main()
  {
   lab_mgt lb;
   clrscr();
   lb.mainmenu();
   getch();
   }

Use UpdatePanel Control in ASP.Net

// Default.aspx //


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>UpdatePanel</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger controlid="UpdateButton2" eventname="Click" />
        </Triggers>
            <ContentTemplate>
                <asp:Label runat="server" id="DateTimeLabel1" />
                <asp:Button runat="server" id="UpdateButton1" onclick="UpdateButton_Click" text="Update" />               
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" id="UpdatePanel1" updatemode="Conditional">           
            <ContentTemplate>
                <asp:Label runat="server" id="DateTimeLabel2" />
                <asp:Button runat="server" id="UpdateButton2" onclick="UpdateButton_Click" text="Update" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>


// Default.aspx.cs //

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

public partial class Default : System.Web.UI.Page
{

  protected void Page_Load(object sender, EventArgs e)
    {
    }
protected void UpdateButton_Click(object sender, EventArgs e)
{

    DateTimeLabel1.Text = DateTime.Now.ToString();
    DateTimeLabel2.Text = DateTime.Now.ToString();
}
}

How to Paging GridView Data in asp.net

<%@ Page Language="C#" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
   
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>asp.net GridView Paging example: how to Paging GridView Data</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2 style="color:Fuchsia">Paging In GridView</h2>  
        <asp:SqlDataSource  
             ID="SqlDataSource1"  
             runat="server"  
             ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"  
             SelectCommand="SELECT ProductID, ProductName, UnitPrice FROM Products"  
             >  
        </asp:SqlDataSource>  
        <asp:GridView  
             ID="GridView1"   
             runat="server"  
             DataSourceID="SqlDataSource1"  
             AutoGenerateColumns="false"  
             BackColor="Snow"  
             ForeColor="DarkMagenta"  
             BorderColor="DimGray"  
             BorderStyle="Dotted"  
             BorderWidth="2"  
             AllowSorting="true"  
             AllowPaging="true"  
             PageSize="5"  
             >  
            <Columns>  
                <asp:BoundField SortExpression="ProductID" HeaderText="Product ID" DataField="ProductID" />  
                <asp:BoundField SortExpression="ProductName" HeaderText="Product Name" DataField="ProductName" />  
                <asp:BoundField SortExpression="UnitPrice" HeaderText="Unit Price" DataField="UnitPrice" />  
            </Columns>  
        </asp:GridView>  
    </div>  
    </form>  
</body>  
</html>