コード例 #1
0
        /// <summary>
        /// Creates a repository for the requested domain
        /// </summary>
        /// <typeparam name="T">Domain for repository</typeparam>
        /// <returns>Domain specific repository</returns>
        public IRepository Create <T>() where T : class, IDomain
        {
            var domain  = _domains.OfType <T>().SingleOrDefault();
            var context = new DomainUnitOfWork <T>(domain);

            return(new DomainRepository <T>(context, domain));
        }
コード例 #2
0
        /// <summary>
        /// Provides CRUD functionality to domain and related skill set.
        /// </summary>
        public DomainService(DomainUnitOfWork domainUnitOfWork)
        {
            if (domainUnitOfWork == null)
            {
                throw new ArgumentNullException(nameof(domainUnitOfWork));
            }

            this.domainUnitOfWork = domainUnitOfWork;
        }
コード例 #3
0
        public void GetOutPatientRegisterPersonTest()
        {
            string       strStartTime        = "2016-1-2";
            string       strEndTime          = "2016-4-11";
            DateTime     startTime           = DateTime.Parse(strStartTime);
            DateTime     endTime             = DateTime.Parse(strEndTime);
            BaseDataTest bst                 = new BaseDataTest(startTime, endTime);
            var          iRegisterInDuration = new Mock <IRegisterInDuration>();

            iRegisterInDuration.Setup(r => r.GetRegisterInDuration(bst.startTime, bst.endTime)).Returns(bst.registersList);
            var factory = new Mock <IDomainInnerFactory>();

            factory.Setup(f => f.CreateRegisterInDuration(EnumOutPatientCategories.OUTPATIENT)).Returns(iRegisterInDuration.Object);

            DomainUnitOfWork uow = new DomainUnitOfWork(factory.Object);

            var result = new ImRegisterPerson.GetOutPatientRegisterPerson(uow).GetRegisterPerson(bst.startTime, bst.endTime);

            Assert.Fail();
        }
コード例 #4
0
        /// <summary>
        /// Provides functionality to list employees, find employees by search criteria, update employee related data.
        /// </summary>
        public EmployeeService(DomainUnitOfWork domain, EmployeeUnitOfWork employee, IdentityUnitOfWork identity)
        {
            if (domain == null)
            {
                throw new ArgumentNullException(nameof(domain));
            }

            if (employee == null)
            {
                throw new ArgumentNullException(nameof(employee));
            }

            if (identity == null)
            {
                throw new ArgumentNullException(nameof(identity));
            }

            domainUnitOfWork   = domain;
            employeeUnitOfWork = employee;
            identityUnitOfWork = identity;
        }
コード例 #5
0
        public void GetDrugCategoriesNumbersTest()
        {
            string       strStartTime = "2016-4-2";
            string       strEndTime   = "2016-4-4";
            DateTime     startTime    = DateTime.Parse(strStartTime);
            DateTime     endTime      = DateTime.Parse(strEndTime);
            BaseDataTest bst          = new BaseDataTest(startTime, endTime);

            var iRegisterInDuration = new Mock <IRegisterInDuration>();

            iRegisterInDuration.Setup(r => r.GetRegisterInDuration(bst.startTime, bst.endTime)).Returns(bst.registersList);
            var factory = new Mock <IDomainInnerFactory>();

            factory.Setup(f => f.CreateRegisterFromPrescription(EnumOutPatientCategories.OUTPATIENT_EMERGEMENT)).Returns(iRegisterInDuration.Object);

            DomainUnitOfWork uow = new DomainUnitOfWork(factory.Object);

            var getDrugCategory = new ImGetDrugCategoriesNumbers(uow);
            var result          = getDrugCategory.GetDrugCategoriesNumbers(bst.startTime, bst.endTime);

            Assert.AreEqual(result, -2);
        }
コード例 #6
0
 public ImTopTenAntibioticDepRank()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #7
0
 public GetOutPatientRegisterPerson(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #8
0
 public GetOutPatientRegisterPerson()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #9
0
 public GetEmergencyRegisterPerson(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #10
0
 public GetEmergencyRegisterPerson()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #11
0
ファイル: ImDrugTopThirtyRank.cs プロジェクト: tilark/PhMS2
 public ImDrugTopThirtyRank(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #12
0
 public ImGetDrugCategoriesNumbers(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #13
0
 public ImGetOutPatientEmergencyCost()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #14
0
 public ImGetEssentialDrugCategoryNumbers()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #15
0
 public ImTopTenAntibioticDepRank(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #16
0
 public GetOutPatientEmergencyAntibioticPerson(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #17
0
 public GetOutPatientEmergencyAntibioticPerson()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #18
0
 public GetOutPatientEmergencyAntibioticCategoryNumber(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #19
0
 public GetOutPatientEmergencyAntibioticCategoryNumber()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #20
0
 public ImOutPatientEmergencyPrescriptionMessage()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #21
0
 public ImOutPatientEmergencyPrescriptionMessage(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #22
0
 public ImGetEssentialDrugCategoryNumbers(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #23
0
ファイル: ImDrugTopThirtyRank.cs プロジェクト: tilark/PhMS2
 public ImDrugTopThirtyRank()
 {
     this.uow = new DomainUnitOfWork();
 }
コード例 #24
0
 public ImGetOutPatientEmergencyCost(DomainUnitOfWork uow)
 {
     this.uow = uow;
 }
コード例 #25
0
 public ImGetDrugCategoriesNumbers()
 {
     this.uow = new DomainUnitOfWork();
 }