GetAll() public method

public GetAll ( ) : List
return List
示例#1
0
        public void Can_GetAllDiagnosis()
        {
            var repo = new DiagnosisRepository();
            var diagnosisList = repo.GetAll();

            Assert.IsNotNull(diagnosisList);
            Assert.IsTrue(diagnosisList.Count > 0);
        }
示例#2
0
        public List<DiagnosisModel> GetAllDiagnosis()
        {
            var diagnosisList = new List<DiagnosisModel>();
            var repo = new HealthInformationProgram.Data.Repositories.DiagnosisRepository();
            try
            {
                var dataList = repo.GetAll();
                foreach (var item in dataList)
                {
                    var diagView = new DiagnosisModel();
                    diagView.DiagnosisId = GetDataValue(item.diag_id);
                    diagView.DiagnosisDescription = GetDataValue(item.diag_descn);
                    diagView.DiagnosisStatus = GetDataValue(item.diag_stat);
                    diagView.DiagnosisAbbreviation = GetDataValue(item.diag_abrvn);
                    diagView.IcdCode = GetDataValue(item.icd_cd);
                    diagView.SortOrder = GetDataValue(item.user_intrfc_sort_ord);
                    diagView.DiagnosisEffectiveStartDate = item.diag_strt_eff_dt.ToString();
                    diagView.DiagnosisEffectiveEndDate = item.diag_end_eff_dt.ToString();
                    diagView.CreateDate = item.rec_creat_dt.ToString();
                    diagView.CreatedBy = GetDataValue(item.rec_creat_user_id_cd);
                    diagView.UpdateDate = item.rec_updt_dt.ToString();
                    diagView.UpdatedBy = GetDataValue(item.rec_updt_user_id_cd);

                    diagnosisList.Add(diagView);

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return diagnosisList;
        }