public void UpdateCondition(int patientNoteId, Condition condition)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var conditionToUpdate = GetConditionById(condition.PatientId, patientNoteId);
             if (conditionToUpdate != null)
             {
                 conditionToUpdate.Name = condition.Name;
                 conditionToUpdate.Notes = condition.Notes;
                 conditionToUpdate.Recovered = condition.Recovered;
                 conditionToUpdate.StartDate = condition.StartDate;
                 conditionToUpdate.EndDate = condition.EndDate;
                 conditionToUpdate.Status = condition.Status;
                 dataContext.Conditions.Attach(conditionToUpdate);
                 dataContext.Entry(conditionToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #2
0
 public void UpdateCondition(int patientNoteId, Condition condition)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var conditionToUpdate = GetConditionById(condition.PatientId, patientNoteId);
             if (conditionToUpdate != null)
             {
                 conditionToUpdate.Name      = condition.Name;
                 conditionToUpdate.Notes     = condition.Notes;
                 conditionToUpdate.Recovered = condition.Recovered;
                 conditionToUpdate.StartDate = condition.StartDate;
                 conditionToUpdate.EndDate   = condition.EndDate;
                 conditionToUpdate.Status    = condition.Status;
                 dataContext.Conditions.Attach(conditionToUpdate);
                 dataContext.Entry(conditionToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateInsurance(int insuranceId, Insurance insurance)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var insuranceToUpdate = GetInsuranceById(insurance.PatientId, insuranceId);
             if (insuranceToUpdate != null)
             {
                 insuranceToUpdate.PlanName = insurance.PlanName;
                 insuranceToUpdate.CoverageType = insurance.CoverageType;
                 insuranceToUpdate.IsPrimary = insurance.IsPrimary;
                 insuranceToUpdate.GroupNumber = insurance.GroupNumber;
                 insuranceToUpdate.SubscriberID = insurance.SubscriberID;
                 insuranceToUpdate.SubscriberDOB = insurance.SubscriberDOB;
                 insuranceToUpdate.SubscriberDate = insurance.SubscriberDate;
                 insuranceToUpdate.ExpirationDate = insurance.ExpirationDate;
                 dataContext.Insurances.Attach(insuranceToUpdate);
                 dataContext.Entry(insuranceToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #4
0
 public void UpdateBloodPressure(int patientNoteId, BloodPressure bloodPressure)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var bloodPressureToUpdate = GetBloodPressureById(bloodPressure.PatientId, patientNoteId);
             if (bloodPressureToUpdate != null)
             {
                 bloodPressureToUpdate.Systolic           = bloodPressure.Systolic;
                 bloodPressureToUpdate.Diastolic          = bloodPressure.Diastolic;
                 bloodPressureToUpdate.IrregularHeartbeat = bloodPressure.IrregularHeartbeat;
                 bloodPressureToUpdate.Pulse = bloodPressure.Pulse;
                 bloodPressureToUpdate.When  = bloodPressure.When;
                 dataContext.BloodPressures.Attach(bloodPressureToUpdate);
                 dataContext.Entry(bloodPressureToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateWeight(int weightId, Weight weight)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var weightToUpdate = GetWeightById(weight.PatientId, weightId);
             if (weightToUpdate != null)
             {
                 weightToUpdate.Date = weight.Date;
                 weightToUpdate.Weight1 = weight.Weight1;
                 weightToUpdate.WeightGoal = weight.WeightGoal;
                 dataContext.Weights.Attach(weightToUpdate);
                 dataContext.Entry(weightToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #6
0
 public void UpdateHeight(int heightId, Height height)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var heightToUpdate = GetHeightById(height.PatientId, heightId);
             if (heightToUpdate != null)
             {
                 heightToUpdate.Date       = height.Date;
                 heightToUpdate.HeightFeet = height.HeightFeet;
                 heightToUpdate.HeightInch = height.HeightInch;
                 dataContext.Heights.Attach(heightToUpdate);
                 dataContext.Entry(heightToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateProcedure(int procedureId, Procedure procedure)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var procedureToUpdate = GetProcedureById(procedure.PatientId, procedureId);
             if (procedureToUpdate != null)
             {
                 procedureToUpdate.Date = procedure.Date;
                 procedureToUpdate.Notes = procedure.Notes;
                 procedureToUpdate.PrimaryProviderId = procedure.PrimaryProviderId;
                 procedureToUpdate.ProcedureName = procedure.ProcedureName;
                 procedureToUpdate.SecondaryProviderId = procedure.SecondaryProviderId;
                 dataContext.Procedures.Attach(procedureToUpdate);
                 dataContext.Entry(procedureToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #8
0
 public void UpdateWeight(int weightId, Weight weight)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var weightToUpdate = GetWeightById(weight.PatientId, weightId);
             if (weightToUpdate != null)
             {
                 weightToUpdate.Date       = weight.Date;
                 weightToUpdate.Weight1    = weight.Weight1;
                 weightToUpdate.WeightGoal = weight.WeightGoal;
                 dataContext.Weights.Attach(weightToUpdate);
                 dataContext.Entry(weightToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateProcedure(int procedureId, Procedure procedure)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var procedureToUpdate = GetProcedureById(procedure.PatientId, procedureId);
             if (procedureToUpdate != null)
             {
                 procedureToUpdate.Date                = procedure.Date;
                 procedureToUpdate.Notes               = procedure.Notes;
                 procedureToUpdate.PrimaryProviderId   = procedure.PrimaryProviderId;
                 procedureToUpdate.ProcedureName       = procedure.ProcedureName;
                 procedureToUpdate.SecondaryProviderId = procedure.SecondaryProviderId;
                 dataContext.Procedures.Attach(procedureToUpdate);
                 dataContext.Entry(procedureToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateBloodPressure(int patientNoteId, BloodPressure bloodPressure)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var bloodPressureToUpdate = GetBloodPressureById(bloodPressure.PatientId, patientNoteId);
             if (bloodPressureToUpdate != null)
             {
                 bloodPressureToUpdate.Systolic = bloodPressure.Systolic;
                 bloodPressureToUpdate.Diastolic = bloodPressure.Diastolic;
                 bloodPressureToUpdate.IrregularHeartbeat = bloodPressure.IrregularHeartbeat;
                 bloodPressureToUpdate.Pulse = bloodPressure.Pulse;
                 bloodPressureToUpdate.When = bloodPressure.When;
                 dataContext.BloodPressures.Attach(bloodPressureToUpdate);
                 dataContext.Entry(bloodPressureToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateHeight(int heightId, Height height)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var heightToUpdate = GetHeightById(height.PatientId, heightId);
             if (heightToUpdate != null)
             {
                 heightToUpdate.Date = height.Date;
                 heightToUpdate.HeightFeet = height.HeightFeet;
                 heightToUpdate.HeightInch = height.HeightInch;
                 dataContext.Heights.Attach(heightToUpdate);
                 dataContext.Entry(heightToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #12
0
 public void UpdateAppointment(int appointmentId, Appointment appointment)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var appoinmentToUpdate = GetAppointmentById(appointment.PatientId, appointmentId);
             if (appoinmentToUpdate != null)
             {
                 appoinmentToUpdate.ProviderId  = appointment.ProviderId;
                 appoinmentToUpdate.Purpose     = appointment.Purpose;
                 appoinmentToUpdate.SpecialtyId = appointment.SpecialtyId;
                 appoinmentToUpdate.StartDate   = appointment.StartDate;
                 appoinmentToUpdate.Type        = appointment.Type;
                 appoinmentToUpdate.EndDate     = appointment.EndDate;
                 dataContext.Entry(appoinmentToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateDietaryIntake(int dietaryIntakeId, DietaryIntake dietaryIntake)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var dietaryIntakeToUpdate = GetDietaryIntakesById(dietaryIntake.PatientId, dietaryIntakeId);
             if (dietaryIntakeToUpdate != null)
             {
                 dietaryIntakeToUpdate.Calories = dietaryIntake.Calories;
                 dietaryIntakeToUpdate.Date = dietaryIntake.Date;
                 dietaryIntakeToUpdate.Meal = dietaryIntake.Meal;
                 dietaryIntakeToUpdate.Name = dietaryIntake.Name;
                 dietaryIntakeToUpdate.Notes = dietaryIntake.Notes;
                 dataContext.DietaryIntakes.Attach(dietaryIntakeToUpdate);
                 dataContext.Entry(dietaryIntakeToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #14
0
 public void UpdateStep(int stepId, Step step)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var stepToUpdate = GetStepById(step.PatientId, stepId);
             if (stepToUpdate != null)
             {
                 stepToUpdate.Date  = step.Date;
                 stepToUpdate.Steps = step.Steps;
                 dataContext.Steps.Attach(stepToUpdate);
                 dataContext.Entry(stepToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #15
0
 public void UpdateInsurance(int insuranceId, Insurance insurance)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var insuranceToUpdate = GetInsuranceById(insurance.PatientId, insuranceId);
             if (insuranceToUpdate != null)
             {
                 insuranceToUpdate.PlanName       = insurance.PlanName;
                 insuranceToUpdate.CoverageType   = insurance.CoverageType;
                 insuranceToUpdate.IsPrimary      = insurance.IsPrimary;
                 insuranceToUpdate.GroupNumber    = insurance.GroupNumber;
                 insuranceToUpdate.SubscriberID   = insurance.SubscriberID;
                 insuranceToUpdate.SubscriberDOB  = insurance.SubscriberDOB;
                 insuranceToUpdate.SubscriberDate = insurance.SubscriberDate;
                 insuranceToUpdate.ExpirationDate = insurance.ExpirationDate;
                 dataContext.Insurances.Attach(insuranceToUpdate);
                 dataContext.Entry(insuranceToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #16
0
 public void UpdateContact(int contactId, Contact contact)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var contactToUpdate = GetContactById(contact.PatientId, contactId);
             if (contactToUpdate != null)
             {
                 contactToUpdate.City            = contact.City;
                 contactToUpdate.Country         = contact.Country;
                 contactToUpdate.EmailAddress    = contact.EmailAddress;
                 contactToUpdate.IsPrimary       = contact.IsPrimary;
                 contactToUpdate.Phone           = contact.Phone;
                 contactToUpdate.PhoneType       = contact.PhoneType;
                 contactToUpdate.StateOrProvince = contact.StateOrProvince;
                 contactToUpdate.StreetAddress1  = contact.StreetAddress1;
                 contactToUpdate.StreetAddress2  = contact.StreetAddress2;
                 contactToUpdate.StreetAddress3  = contact.StreetAddress3;
                 dataContext.Contacts.Attach(contactToUpdate);
                 dataContext.Entry(contactToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdatePatientNotes(int patientNoteId, PatientNote patientNote)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var patientNoteToUpdate = GetPatientNoteById(patientNote.PatientId, patientNoteId);
             if (patientNoteToUpdate != null)
             {
                 patientNoteToUpdate.Notes   = patientNote.Notes;
                 patientNoteToUpdate.Date    = patientNote.Date;
                 patientNoteToUpdate.Subject = patientNote.Subject;
                 dataContext.PatientNotes.Attach(patientNoteToUpdate);
                 dataContext.Entry(patientNoteToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #18
0
 public void UpdateDietaryIntake(int dietaryIntakeId, DietaryIntake dietaryIntake)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var dietaryIntakeToUpdate = GetDietaryIntakesById(dietaryIntake.PatientId, dietaryIntakeId);
             if (dietaryIntakeToUpdate != null)
             {
                 dietaryIntakeToUpdate.Calories = dietaryIntake.Calories;
                 dietaryIntakeToUpdate.Date     = dietaryIntake.Date;
                 dietaryIntakeToUpdate.Meal     = dietaryIntake.Meal;
                 dietaryIntakeToUpdate.Name     = dietaryIntake.Name;
                 dietaryIntakeToUpdate.Notes    = dietaryIntake.Notes;
                 dataContext.DietaryIntakes.Attach(dietaryIntakeToUpdate);
                 dataContext.Entry(dietaryIntakeToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #19
0
 public void UpdateMedication(int medicationId, Medication medication)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var medicationToUpdate = GetMedicationById(medication.PatientId, medicationId);
             if (medicationToUpdate != null)
             {
                 medicationToUpdate.DoseText        = medication.DoseText;
                 medicationToUpdate.DoseUnit        = medication.DoseUnit;
                 medicationToUpdate.HowTaken        = medication.HowTaken;
                 medicationToUpdate.MedicationName  = medication.MedicationName;
                 medicationToUpdate.Notes           = medication.Notes;
                 medicationToUpdate.ReasonForTaking = medication.ReasonForTaking;
                 medicationToUpdate.StrengthText    = medication.StrengthText;
                 medicationToUpdate.StrengthUnit    = medication.StrengthUnit;
                 if (medication.EndDate != null)
                 {
                     medicationToUpdate.EndDate = medication.EndDate;
                 }
                 dataContext.Medications.Attach(medicationToUpdate);
                 dataContext.Entry(medicationToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
Example #20
0
 public void UpdateAppointmentStatus(int appointmentId, int patientID, string status)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var appoinmentToUpdate = GetAppointmentById(patientID, appointmentId);
             if (appoinmentToUpdate != null)
             {
                 appoinmentToUpdate.Status = status;
                 dataContext.Entry(appoinmentToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdatePatientNotes(int patientNoteId, PatientNote patientNote)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var patientNoteToUpdate = GetPatientNoteById(patientNote.PatientId, patientNoteId);
             if (patientNoteToUpdate != null)
             {
                 patientNoteToUpdate.Notes = patientNote.Notes;
                 patientNoteToUpdate.Date = patientNote.Date;
                 patientNoteToUpdate.Subject = patientNote.Subject;
                 dataContext.PatientNotes.Attach(patientNoteToUpdate);
                 dataContext.Entry(patientNoteToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateMedication(int medicationId, Medication medication)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var medicationToUpdate = GetMedicationById(medication.PatientId, medicationId);
             if (medicationToUpdate != null)
             {
                 medicationToUpdate.DoseText = medication.DoseText;
                 medicationToUpdate.DoseUnit = medication.DoseUnit;
                 medicationToUpdate.HowTaken = medication.HowTaken;
                 medicationToUpdate.MedicationName = medication.MedicationName;
                 medicationToUpdate.Notes = medication.Notes;
                 medicationToUpdate.ReasonForTaking = medication.ReasonForTaking;
                 medicationToUpdate.StrengthText = medication.StrengthText;
                 medicationToUpdate.StrengthUnit = medication.StrengthUnit;
                 if (medication.EndDate != null)
                     medicationToUpdate.EndDate = medication.EndDate;
                 dataContext.Medications.Attach(medicationToUpdate);
                 dataContext.Entry(medicationToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateContact(int contactId, Contact contact)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var contactToUpdate = GetContactById(contact.PatientId, contactId);
             if (contactToUpdate != null)
             {
                 contactToUpdate.City = contact.City;
                 contactToUpdate.Country = contact.Country;
                 contactToUpdate.EmailAddress = contact.EmailAddress;
                 contactToUpdate.IsPrimary = contact.IsPrimary;
                 contactToUpdate.Phone = contact.Phone;
                 contactToUpdate.PhoneType = contact.PhoneType;
                 contactToUpdate.StateOrProvince = contact.StateOrProvince;
                 contactToUpdate.StreetAddress1 = contact.StreetAddress1;
                 contactToUpdate.StreetAddress2 = contact.StreetAddress2;
                 contactToUpdate.StreetAddress3 = contact.StreetAddress3;
                 dataContext.Contacts.Attach(contactToUpdate);
                 dataContext.Entry(contactToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateAppointmentStatus(int appointmentId, int patientID, string status)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var appoinmentToUpdate = GetAppointmentById(patientID, appointmentId);
             if (appoinmentToUpdate != null)
             {
                 appoinmentToUpdate.Status = status;
                 dataContext.Entry(appoinmentToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }
 public void UpdateAppointment(int appointmentId, Appointment appointment)
 {
     using (var dataContext = new eHealthCareEntities())
     {
         try
         {
             var appoinmentToUpdate = GetAppointmentById(appointment.PatientId, appointmentId);
             if (appoinmentToUpdate != null)
             {
                 appoinmentToUpdate.ProviderId = appointment.ProviderId;
                 appoinmentToUpdate.Purpose = appointment.Purpose;
                 appoinmentToUpdate.SpecialtyId = appointment.SpecialtyId;
                 appoinmentToUpdate.StartDate = appointment.StartDate;
                 appoinmentToUpdate.Type = appointment.Type;
                 appoinmentToUpdate.EndDate = appointment.EndDate;
                 dataContext.Entry(appoinmentToUpdate).State = EntityState.Modified;
                 dataContext.SaveChanges();
             }
         }
         catch (DbEntityValidationException ex)
         {
             throw new Exception(ex.EntityValidationErrors.GetValidationErrors());
         }
         catch
         {
             throw;
         }
     }
 }