public Response <foPatient> AssignPatient(foPatient patient, foDoctor doctor)
        {
            try
            {
                using (HMSgeneralentity db = new HMSgeneralentity())
                {
                    db.foDoctorAssignments.Add(new foDoctorAssignment()
                    {
                        DoctorId  = doctor.Id,
                        PatientId = patient.Id
                    });

                    var result = db.SaveChanges();

                    if (result > 0)
                    {
                        return(new SucessResponse <foPatient>());
                    }
                    else
                    {
                        throw new Exception("Not Saved");
                    }
                };
            }
            catch (Exception ex)
            {
                return(new FailureResponse <foPatient>(ex));
            }
        }
Example #2
0
        private void DataBind()
        {
            patient = new foPatient();

            foPatientBindingSource.Clear();
            foPatientBindingSource.Add(patient);
            //genderBindingSource.DataSource = Gender.Get();
            maternalStateBindingSource.DataSource = MaternalState.Get();
        }
        public void loadsdata()
        {
            medicalHisotry = db.FoPastMedicalHistories.Where(mh => mh.PatientId == _patientId).FirstOrDefault();
            patient        = db.foPatients.FirstOrDefault(p => p.Id == _patientId);

            if (medicalHisotry == null)
            {
                medicalHisotry = new FoPastMedicalHistory();
                isNew          = true;
                IntitalizemedicalHisotry();
            }

            name.Text  = patient.FullName;
            sex.Text   = patient.Sex;
            RegNO.Text = patient.Id.ToString();
            Age.Text   = patient.Age.ToString();
        }