Esempio n. 1
0
        /// <summary>
        /// Filters diagnoses by name and number and sets the datagrdview source
        /// </summary>
        /// <param name="name"></param>
        /// <param name="number"></param>
        public void LoadDiagnosesByCriterias(string subject, int patientId)
        {
            try
            {
                IQueryable <Diagnosis> diagnosesQuery;
                diagnosesQuery = DiagnosesDataAccess.GetDiagnoses();

                if (!string.IsNullOrEmpty(subject))
                {
                    diagnosesQuery = diagnosesQuery.Where(d => d.Subect.Contains(subject));
                }

                if (patientId != 0)
                {
                    diagnosesQuery = diagnosesQuery.Where(d => d.PatientId == patientId);
                }


                this.Diagnoses = diagnosesQuery.ToList();
            }
            catch (Exception e)
            {
                this.Message = "Грешка при заявка към базатa от данни!Обадете се на администратор!";
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Filters diagnoses by name and number and sets the datagrdview source
        /// </summary>
        /// <param name="name"></param>
        /// <param name="number"></param>
        public void LoadDiagnosesByCriterias(string subject, int patientId)
        {
            try
            {
                IQueryable <Diagnosis> diagnosesQuery;
                diagnosesQuery = DiagnosesDataAccess.GetDiagnoses();

                if (!string.IsNullOrEmpty(subject))
                {
                    diagnosesQuery = diagnosesQuery.Where(d => d.Subect.Contains(subject));
                }

                if (patientId != 0)
                {
                    diagnosesQuery = diagnosesQuery.Where(d => d.PatientId == patientId);
                }


                this.Diagnoses = diagnosesQuery.ToList();
            }
            catch (Exception e)
            {
                this.Message = "Ошибка при запросе базы данных!Вызовите администратора!";
            }
        }