Esempio n. 1
0
        public IEnumerable<Wrapper2> GetContainerLabels(int arlNumber)
        {
            SmartCollection<SampleContainer> results = new SmartCollection<SampleContainer>();

            try
            {
                using (SampleDAO sampleDao = new SampleDAO())
                {
                    results = sampleDao.GetContainerLabels(arlNumber);
                }
                return IndexData(results);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        public Sample DoGetSampleCoaData(int sampleId, int? billGroupId, int departmentId, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSampleCoaData(sampleId, billGroupId, departmentId, identification);
            }
        }
Esempio n. 3
0
        public int DoFinalizeSampleTestSubmission(int id, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.FinalizeSampleTestSubmission(id, identification);
            }
        }
Esempio n. 4
0
        public string DoCreateMultiSampleInvoice(string arlNumbers, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO())
            {
                return dao.CreateMultiSampleInvoice(arlNumbers, identification);
            }
        }
Esempio n. 5
0
        public int DoCreateCoaReport(Sample sample, Identification identification)
        {
            ReportRecord reportRecord = null;

            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                reportRecord = dao.CreateCoaReport(sample, identification);
            }
            if (reportRecord.Id.IsNotNull() && reportRecord.Id > 0) {
                using (ClientDAO customerDao = new ClientDAO()) {
                    reportRecord.ParentId = customerDao.GetClientId(reportRecord.ParentId.Value);
                }
                using (ReportDAO reportDao = new ReportDAO()) {
                    ReportNotification reportNotification = new ReportNotification();
                    reportNotification.ReportId = reportRecord.Id.Value;
                    reportNotification.CustomerId = reportRecord.ParentId.Value;
                    reportNotification.DepartmentId = reportRecord.DepartmentId.Value;
                    reportNotification.SubjectLine = reportRecord.SubjectLine;
                    reportDao.SaveNotificationReports(reportDao.GetNotificationRecords(reportNotification));
                }
            }

            return reportRecord.Id.Value;
        }
Esempio n. 6
0
        public int DoCancelSample(int arlNumber, bool descriptionYN,
                                bool storageYN, bool containersYN, bool containerDescriptionYN, bool fillVolumeYN, bool dosageYN,
                                bool analytesYN, bool testsYN, bool chargesYN, bool notesYN, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO())
            {
                return dao.CloneSample(arlNumber, descriptionYN, storageYN, containersYN, containerDescriptionYN,
                                       fillVolumeYN, dosageYN, analytesYN, testsYN, chargesYN, notesYN, identification);
            }
        }
Esempio n. 7
0
        public int DoApproveSampleSubmission(Sample sample, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.ApproveSampleSubmission(sample, identification);
            }
        }
Esempio n. 8
0
        public SmartCollection<Order> DoSearchOrders(string searchString, Collection<SearchItem> searchItems, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.SearchOrders(searchString, searchItems, identification);
            }
        }
Esempio n. 9
0
        public List<DateTime> DoGetSubmissionHistoryForLast12Months(int? customerId)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSubmissionHistoryForLast12Months(customerId);
            }
        }
Esempio n. 10
0
        public SmartCollection<SampleTest> DoGetSampleTestsResultsList(SmartCollection<SampleTest> list, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSampleTestsResultsList(list, identification);
            }
        }
Esempio n. 11
0
        public SmartCollection<SampleTest> DoGetSampleTests(int arlNumber, bool loadCanceled, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSampleTests(arlNumber, loadCanceled, identification);
            }
        }
Esempio n. 12
0
        public SmartCollection<Sample> DoGetSamples(string searchString, Guid userToken, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSamples(searchString, identification);
            }
        }
Esempio n. 13
0
        public SmartCollection<SampleNote> DoGetSampleNotes(int arlNumber, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetSampleNotes(arlNumber, identification);
            }
        }
Esempio n. 14
0
        public SmartCollection<SampleDocument> DoGetSampleDocuments(int arlNumber)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (var dao = new SampleDAO())
            {
                return dao.GetSampleDocuments(arlNumber);
            }
        }
Esempio n. 15
0
        public byte[] DoGetSampleDocumentData(int sampleDocumentId)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (var dao = new SampleDAO())
            {
                return dao.GetSampleDocumentData(sampleDocumentId);
            }
        }
Esempio n. 16
0
        public int DoSaveResults(SmartCollection<Result> results, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            // Save Results
            using (SampleDAO dao = new SampleDAO())
            {
                return dao.SaveResults(results, identification);
            }
        }
Esempio n. 17
0
        public int DoSaveSample(Sample sample, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            //Validate Order Object
            if (!sample.ValidateModel())
                throw new FaultException<ServiceFault>(new ServiceFault(sample.CurrentErrors), new FaultReason(SysVars.InvalidFormat));

            // Validate All SampleTests
            Dictionary<string, List<string>> sampleTestErrors = new Dictionary<string, List<string>>();
            foreach (SampleTest sampleTest in sample.SampleTests)
            {
                if (!sampleTest.ValidateModel())
                    sampleTestErrors = sampleTest.CurrentErrors;
            }
            if (sampleTestErrors.Count > 0)
                throw new FaultException<ServiceFault>(new ServiceFault(sampleTestErrors), new FaultReason(SysVars.InvalidFormat));

            // Validate All SampleCharges
            Dictionary<string, List<string>> chargesErrors = new Dictionary<string, List<string>>();
            foreach (SampleCharge charge in sample.SampleCharges)
            {
                if (!charge.ValidateModel())
                    chargesErrors = charge.CurrentErrors;
            }
            if (chargesErrors.Count > 0)
                throw new FaultException<ServiceFault>(new ServiceFault(chargesErrors), new FaultReason(SysVars.InvalidFormat));

            // Validate All SampleNotes
            Dictionary<string, List<string>> notesErrors = new Dictionary<string, List<string>>();
            foreach (SampleNote note in sample.SampleNotes)
            {
                if (!note.ValidateModel())
                    notesErrors = note.CurrentErrors;
            }
            if (notesErrors.Count > 0)
                throw new FaultException<ServiceFault>(new ServiceFault(notesErrors), new FaultReason(SysVars.InvalidFormat));

            // Save Order
            using (SampleDAO dao = new SampleDAO())
            {
                return dao.SaveSample(sample, identification);
            }
        }
Esempio n. 18
0
        public SmartCollection<Submission> DoGetWebSubmissions(Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetWebSubmissions(identification);
            }
        }
Esempio n. 19
0
        public SmartCollection<SampleTest> DoSearchSampleTestResults(string searchString, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.SearchResultSampleTests(searchString, identification);
            }
        }
Esempio n. 20
0
        public SmartCollection<SampleTest> DoGetWorkLoad(CatalogItem filterItem, SmartCollection<Analyte> filterAnalytes, DateTime beginStartDate, DateTime beginEndDate, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetWorkLoad(filterItem, filterAnalytes, beginStartDate, beginEndDate, identification);
            }
        }
Esempio n. 21
0
        public SmartCollection<Order> DoBeginSearchModuleOrders(int? customerId, DateTime? orderReceivedStartDate, DateTime? orderReceivedEndDate, int? testId, int? analyteId)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.SearchModuleOrders(customerId, orderReceivedStartDate, orderReceivedEndDate, testId, analyteId);
            }
        }
Esempio n. 22
0
        public List<DateTime> DoGetWorkloadDates(int analystId)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetWorkloadDates(analystId);
            }
        }
Esempio n. 23
0
        public int DoCancelSampleTest(int id, SampleNote note, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.CancelSampleTest(id, note, identification);
            }
        }
Esempio n. 24
0
        public int DoImportSample(int requestId, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO())
            {
                return dao.ImportSample(requestId, identification);
            }
        }
Esempio n. 25
0
        public string DoCreateInvoice(Invoice invoice, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.CreateInvoice(invoice, identification);
            }
        }
Esempio n. 26
0
        public int DoRemoveSampleTest(int id, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.RemoveOrderSampleTest(id, identification.UserId);
            }
        }
Esempio n. 27
0
        public int DoDeleteOos(int oosId, string reason, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            // Delete Oos
            using (SampleDAO dao = new SampleDAO())
            {
                return dao.DeleteOOS(oosId, reason, identification);
            }
        }
Esempio n. 28
0
        public int DoReturnToOos(TimePoint timePoint, SampleNote note, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.ReturnToOos(timePoint, note, identification);
            }
        }
Esempio n. 29
0
        public SmartCollection<Sample> DoGetClientSamples(int clientId, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO())
            {
                return dao.GetClientSamples(clientId, identification);
            }
        }
Esempio n. 30
0
        public int DoSaveOos(Oos oos, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            //Validate Oos Object
            if (!oos.ValidateModel())
                throw new FaultException<ServiceFault>(new ServiceFault(oos.CurrentErrors), new FaultReason(SysVars.InvalidFormat));
            // Save Oos
            using (SampleDAO dao = new SampleDAO()) {
                return dao.SaveOOS(oos, identification);
            }
        }