Example #1
0
 // here we can add doctors
 public bool AddDocter(Doctor DR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         hms.Doctors.Add(DR);
         hms.SaveChanges();
     }
     return(true);
 }
Example #2
0
 //here we can register patient
 public bool PatientRegister(PatientRegister PR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         hms.PatientRegisters.Add(PR);
         hms.SaveChanges();
     }
     return(true);
 }
Example #3
0
 public bool Appoinment(PatientRegister SearchModel)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         // i put business logic in a (PatientRegister.cs) for sorting by Id,Name,Phone
         var business = new ProductBusinessLogic();
         var model    = business.PatientRegister(SearchModel);
     }
     return(true);
 }
Example #4
0
 // here we can delet patient record
 public bool DeleteDoctor(Doctor DR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         Doctor DeleteDoctor = (from d in hms.Doctors
                                where d.Id == DR.Id
                                select d).FirstOrDefault();
         hms.Doctors.Remove(DeleteDoctor);
         hms.SaveChanges();
     }
     return(true);
 }
Example #5
0
 // here we can delet patient record
 public bool DeletePatient(PatientRegister PR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         PatientRegister DeletePatient = (from c in hms.PatientRegisters
                                          where c.PatientId == PR.PatientId
                                          select c).FirstOrDefault();
         hms.PatientRegisters.Remove(DeletePatient);
         hms.SaveChanges();
     }
     return(true);
 }
Example #6
0
 public void UpdateDoctor(Doctor DR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         int id = DR.Id;
         if (ModelState.IsValid)
         {
             DR.Id = id;
             hms.Entry(DR).State = EntityState.Modified;
             hms.SaveChanges();
         }
     }
 }
Example #7
0
 // here we can update patient what i register in above method
 public bool UpdatePatient(PatientRegister PR)
 {
     using (HMS_APIEntities hms = new HMS_APIEntities())
     {
         PatientRegister UpdatedPatient = (from p in hms.PatientRegisters
                                           where p.PatientId == PR.PatientId
                                           select p).FirstOrDefault();
         UpdatedPatient.Name  = PR.Name;
         UpdatedPatient.Phone = PR.Phone;
         UpdatedPatient.CNIC  = PR.CNIC;
         hms.SaveChanges();
     }
     return(true);
 }
Example #8
0
        public string GetAllDoctorSalries(int did)
        {
            using (HMS_APIEntities db = new HMS_APIEntities())
            {
                string output = "";


                var list = db.Doctors.Single(s => s.Id == did);

                if (list.Salary == null)
                {
                    output = "--";
                }
                else
                {
                    output = String.Format("{0:0.##}", list.Salary);
                }
                return(output);
            }
        }
Example #9
0
 public PatientRegister()
 {
     Context = new HMS_APIEntities();
 }