public List <StudyModel> ReadStudiesList()
        {
            string query = @"
                select IdStudy, IdProfile, IdEmployee, IdOrder, IdStatus, DateOfStudy
                from Studies
            ";

            return(BaseDAO.Select(query, ReadStudyModel));
        }
예제 #2
0
        public List <VerificationModel> ReadVerificationsList()
        {
            string query = @"
                select IdVerification, IdResult, IdEmployee, DateOfVerification, Description
                from Verifications
            ";

            return(BaseDAO.Select(query, ReadVerificationModel));
        }
예제 #3
0
        public List <ResultModel> ReadResultsList()
        {
            string query = @"
                select IdResult, IdEmployee, IdStudy, DateOfResult, Description, ReasonForRepeat, Actual
                from Results
            ";

            return(BaseDAO.Select(query, ReadResultModel));
        }
예제 #4
0
        public List <SampleModel> ReadSamplesList()
        {
            string query = @"
                select IdSample, IdEmployee, IdStudy, DateOfCollection, Code
                from Samples
            ";

            return(BaseDAO.Select(query, ReadSampleModel));
        }
예제 #5
0
        public List <ResultUnitModel> ReadResultUnitsList()
        {
            string query = @"
                select IdResultUnit, IdOrderedTests, IdResult, Value
                from ResultUnits
            ";

            return(BaseDAO.Select(query, ReadResultUnitModel));
        }
예제 #6
0
        public List <UserModel> ReadUsersList()
        {
            string query = @"
                select IdUser, IdEmployee, Login, Password, DateOfChange, InUse
                from Users
            ";

            return(BaseDAO.Select(query, ReadUserModel));
        }
        public DictionaryModel ReadDictionaryById(DictionaryTypesEnum type, long?id, string lang)
        {
            if (id != null)
            {
                string query = "";
                switch (type)
                {
                case DictionaryTypesEnum.Positions:
                    query = $@"
                            select p.IdPosition as Id, t.Name as Name
                            from Positions p
                            join PositionTranslations t on p.IdPosition = t.IdPosition 
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where p.IdPosition = {id} and l.code = '{lang}'
                        ";
                    break;

                case DictionaryTypesEnum.Ward:
                    query = $@"
                            select p.IdWard as Id, t.Name as Name
                            from Wards p
                            join WardTranslations t on p.IdWard = t.IdWard 
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where p.IdWard = {id} and l.code = '{lang}'
                        ";
                    break;

                case DictionaryTypesEnum.Priorities:
                    query = $@"
                            select p.IdPriority as Id, t.Name as Name
                            from Priorities p
                            join PriorityTranslations t on p.IdPriority = t.IdPriority
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where p.IdPriority = {id} and l.code = '{lang}'
                        ";
                    break;

                case DictionaryTypesEnum.Status:
                    query = $@"
                            select p.IdStatus as Id, t.Name as Name
                            from Status p
                            join StatusTranslations t on p.IdStatus = t.IdStatus
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where p.IdStatus = {id} and l.code = '{lang}'
                        ";
                    break;
                }
                DictionaryModel model = BaseDAO.SelectFirst(query, ReadDictionaryModel);
                model.Type = type;
                return(model);
            }
            else
            {
                return(null);
            }
        }
        public List <StudyModel> ReadStudiesListByOrderId(long?id)
        {
            string query = $@"
                select IdStudy, IdProfile, IdEmployee, IdOrder, IdStatus, DateOfStudy
                from Studies
                where IdOrder = {id}
            ";

            return(BaseDAO.Select(query, ReadStudyModel));
        }
        public StudyModel ReadStudyById(long?id)
        {
            string query = $@"
                select IdStudy, IdProfile, IdEmployee, IdOrder, IdStatus, DateOfStudy
                from Studies
                where IdStudy = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadStudyModel));
        }
예제 #10
0
        public ResultModel ReadResultById(long id)
        {
            string query = $@"
                select IdResult, IdEmployee, IdStudy, DateOfResult, Description, ReasonForRepeat, Actual
                from Results
                where IdResult = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadResultModel));
        }
예제 #11
0
        public VerificationModel ReadVerificationByResultId(long id)
        {
            string query = $@"
                select IdVerification, IdResult, IdEmployee, DateOfVerification, Description
                from Verifications
                where IdResult = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadVerificationModel));
        }
예제 #12
0
        public UserModel ReadUserById(long id)
        {
            string query = $@"
                select IdUser, IdEmployee, Login, Password, DateOfChange, InUse
                from Users
                where IdUser = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadUserModel));
        }
예제 #13
0
        public List <ResultUnitModel> ReadResultUnitModelByResultId(long id)
        {
            string query = $@"
                select IdResultUnit, IdOrderedTests, IdResult, Value
                from ResultUnits
                where IdResult = {id}
            ";

            return(BaseDAO.Select(query, ReadResultUnitModel));
        }
        public List <EmployeeModel> ReadEmployeesList()
        {
            string query = @"
                select IdEmployee, IdPosition, FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, 
                    Phone, Email, DateOfEmployment, DateOfLaying, LicenseNumber, IdWard
                from Employees
            ";

            return(BaseDAO.Select(query, ReadEmployeeModel));
        }
예제 #15
0
        public SampleModel ReadSampleByStudyId(long id)
        {
            string query = $@"
                select IdSample, IdEmployee, IdStudy, DateOfCollection, Code
                from Samples
                where IdStudy = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadSampleModel));
        }
예제 #16
0
        public List <OrderModel> ReadOrdersList()
        {
            string query = @"
                select IdOrder, IdPatient, IdEmployee, IdWard, Institution, Comment, DateOfOrder, DateOfReceived, IdStatus,
                    IdPriority
                from Orders
            ";

            return(BaseDAO.Select(query, ReadOrderModel));
        }
        public List <PatientModel> ReadPatientsList()
        {
            string query = @"
                select IdPatient, FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, IdCardNumber, Insurance, 
                    ContactPersonFirstName, ContactPersonSurname, ContactPersonPesel, ContactPersonPhone 
                from Patients
            ";

            return(BaseDAO.Select(query, ReadPatientModel));
        }
        public List <EmployeeModel> ReadConsultantsList(long idOrder)
        {
            string query = $@"
                select e.IdEmployee, e.IdPosition, e.FirstName, e.Surname, e.Pesel, e.Sex, e.Street, e.HouseNumber, e.City, e.PostalCode, e.Country, 
                    e.Phone, e.Email, e.DateOfEmployment, e.DateOfLaying, e.LicenseNumber, e.IdWard
                from Employees e join Consultants c on e.IdEmployee = c.IdEmployee 
                where c.IdOrder = {idOrder}
            ";

            return(BaseDAO.Select(query, ReadEmployeeModel));
        }
        public EmployeeModel ReadEmployeeById(long id)
        {
            string query = $@"
                select IdEmployee, IdPosition, FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, 
                    Phone, Email, DateOfEmployment, DateOfLaying, LicenseNumber, IdWard
                from Employees
                where IdEmployee = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadEmployeeModel));
        }
        public PatientModel ReadPatientById(long id)
        {
            string query = $@"
                select IdPatient, FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, IdCardNumber, Insurance, 
                    ContactPersonFirstName, ContactPersonSurname, ContactPersonPesel, ContactPersonPhone
                from Patients 
                where IdPatient = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadPatientModel));
        }
예제 #21
0
        public OrderModel ReadOrderById(long id)
        {
            string query = $@"
                select IdOrder, IdPatient, IdEmployee, IdWard, Institution, Comment, DateOfOrder, DateOfReceived, IdStatus,
                    IdPriority
                from Orders
                where IdOrder = {id}
            ";

            return(BaseDAO.SelectFirst(query, ReadOrderModel));
        }
        public List <DictionaryModel> ReadDictionaryListByType(DictionaryTypesEnum type, string lang)
        {
            string query = "";

            switch (type)
            {
            case DictionaryTypesEnum.Positions:
                query = $@"
                        select p.IdPosition as Id, t.Name as Name
                        from Positions p
                        join PositionTranslations t on p.IdPosition = t.IdPosition 
                        join Languages l on t.IdLanguage = l.IdLanguage
                        where l.code = '{lang}'
                    ";
                break;

            case DictionaryTypesEnum.Ward:
                query = $@"
                        select p.IdWard as Id, t.Name as Name
                        from Wards p
                        join WardTranslations t on p.IdWard = t.IdWard 
                        join Languages l on t.IdLanguage = l.IdLanguage
                        where l.code = '{lang}'
                    ";
                break;

            case DictionaryTypesEnum.Priorities:
                query = $@"
                            select p.IdPriority as Id, t.Name as Name
                            from Priorities p
                            join PriorityTranslations t on p.IdPriority = t.IdPriority
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where l.code = '{lang}'
                        ";
                break;

            case DictionaryTypesEnum.Status:
                query = $@"
                            select p.IdStatus as Id, t.Name as Name
                            from Status p
                            join StatusTranslations t on p.IdStatus = t.IdStatus
                            join Languages l on t.IdLanguage = l.IdLanguage
                            where l.code = '{lang}'
                        ";
                break;
            }
            List <DictionaryModel> list = BaseDAO.Select(query, ReadDictionaryModel);

            foreach (DictionaryModel model in list)
            {
                model.Type = type;
            }
            return(list);
        }
        public ProfileModel ReadProfileById(long?id, string lang)
        {
            string query = $@"
                select p.IdProfile, p.Code, p.Permament, t.Name as Name
                from Profiles p
                join ProfileTranslations t on p.IdProfile = t.IdProfile
                join Languages l on t.IdLanguage = l.IdLanguage
                where p.IdProfile = {id} and l.code = '{lang}'
            ";

            return(BaseDAO.SelectFirst(query, ReadProfileModel));
        }
        public List <ProfileModel> ReadProfilesList(string lang)
        {
            string query = $@"
                select p.IdProfile, p.Code, p.Permament, t.Name as Name
                from Profiles p
                join ProfileTranslations t on p.IdProfile = t.IdProfile
                join Languages l on t.IdLanguage = l.IdLanguage
                where l.code = '{lang}'
            ";

            return(BaseDAO.Select(query, ReadProfileModel));
        }
예제 #25
0
        public TestModel ReadTestById(long id, string lang)
        {
            string query = $@"
                select t.IdTest, t.IdProfile, t.Code, t.NormMinM, t.NormMaxM, t.NormMinF, t.NormMaxF, tr.Name as Name
                from Tests t
                join TestTranslations tr on t.IdTest = tr.IdTest
                join Languages l on tr.IdLanguage = l.IdLanguage
                where t.IdTest = {id} and l.code = '{lang}'
            ";

            return(BaseDAO.SelectFirst(query, ReadTestModel));
        }
예제 #26
0
        public List <TestModel> ReadTestsList(string lang)
        {
            string query = $@"
                select t.IdTest, t.IdProfile, t.Code, t.NormMinM, t.NormMaxM, t.NormMinF, t.NormMaxF, tr.Name as Name
                from Tests t
                join TestTranslations tr on t.IdTest = tr.IdTest
                join Languages l on tr.IdLanguage = l.IdLanguage
                where l.code = '{lang}'
            ";

            return(BaseDAO.Select(query, ReadTestModel));
        }