HealthInformationProgram.Data.Repositories.SupplementalDiagnosisCategoryRepository.GetAll C# (CSharp) Метод

GetAll() публичный Метод

public GetAll ( ) : List
Результат List
        public List<lkup_splmtl_diag_cat> GetAll()
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {

                    return ctx.lkup_splmtl_diag_cat.OrderBy(x => x.user_intrfc_sort_ord).ToList();
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }

Usage Example

Пример #1
0
        public List<SupplementalDiagnosisCategoryModel> GetAllSupplementalCategories()
        {
            var categories = new List<SupplementalDiagnosisCategoryModel>();
            var repo = new HealthInformationProgram.Data.Repositories.SupplementalDiagnosisCategoryRepository();

            var dataList = repo.GetAll();
            foreach (var item in dataList)
            {
                var cat = new SupplementalDiagnosisCategoryModel();

                cat.SupplementalDiagnosisCategoryId = GetDataValue(item.splmtl_diag_cat_id);
                cat.SupplementalDiagnosisCategoryType = GetDataValue(item.splmtl_diag_cat);
                cat.SortOrder = GetDataValue(item.user_intrfc_sort_ord);
                cat.Status = GetDataValue(item.splmtl_diag_cat_stat);
                cat.SupplementalDiagnosisCategoryEffectiveStartDate = GetDataValue(item.splmtl_diag_cat_strt_eff_dt);
                cat.SupplementalDiagnosisCategoryEffectiveEndDate = GetDataValue(item.splmtl_diag_cat_end_eff_dt);
                cat.UpdatedBy = GetDataValue(item.rec_updt_user_id_cd);
                cat.UpdateDate = GetDataValue(item.rec_updt_dt);
                cat.CreatedBy = GetDataValue(item.rec_creat_user_id_cd);
                cat.CreateDate = GetDataValue(item.rec_creat_dt);

                categories.Add(cat);
            }
            return categories;
        }