示例#1
18
 public void Invoke(ObjectFactory objectFactory, string[] scenarioTags)
 {
     if (!HasTags || ScenarioHasMatchingTag(scenarioTags, Tag))
     {
         Invoke(objectFactory);
     }
 }
        public void Can_resolve_geofence_service()
        {
            var objectFactory = new ObjectFactory();
            var geofenceService = objectFactory.Create<IGeofenceService>();

            Assert.That(geofenceService, Is.Not.Null);
        }
 public void Should_have_DisposeObjects_method()
 {
     ObjectFactory objectFactory = new ObjectFactory();
     objectFactory.AddClass(typeof(Dummy));
     objectFactory.CreateObjects();
     objectFactory.DisposeObjects();
 }
 public void Should_have_GetObject_method()
 {
     ObjectFactory objectFactory = new ObjectFactory();
     objectFactory.AddClass(typeof(Dummy));
     objectFactory.CreateObjects();
     Dummy dummy = (Dummy) objectFactory.GetObject(typeof(Dummy));
 }
示例#5
0
        public void InitGame()
        {
            //var game = Control.Instance;

            //this.visualization.PrintStartMessage();

            //var labyrinth = game.Setup.SetupNewLabyrinth();
            //game.State.IsInitialized = true;

            IObjectFactory instanceFactory = new ObjectFactory();
             Labyrinth labyrinth = new Labyrinth(LabyrinthSize, LabyrinthSize, instanceFactory);
            GameObjectsGenerator generator = new GameObjectsGenerator();
            generator.GenerateObjectsNew(labyrinth);

            this.visualization.PrintMessage("Labyrinth is Ready");

            this.visualization.DrawLabyrinth(labyrinth);
            MovesFactory movesFactory = new MovesFactory(labyrinth);
            while (!labyrinth.State.IsFinished)
            {
                IMoves move = this.visualization.GetUserCommand(movesFactory);
                move.Move();
                this.visualization.DrawLabyrinth(labyrinth);
            }
        }
        public void Can_resolve_startup_manager()
        {
            var objectFactory = new ObjectFactory();
            var manager = objectFactory.Create<IStartupManager>();

            Assert.That(manager, Is.Not.Null);
        }
        public void GenerateSubjects(TypeContext typeContext)
        {
            var types = typeContext.ClassMethodList.Keys;
            var invokerObjects = new ObjectFactory().GenerateObjects(typeof(SubjectAttribute), types);

            _subjects = invokerObjects.Select(SubjectProxy.Create).ToList();
        }
    public ObjectFactory()
    {
        instance = this;

        creationTable = new Dictionary<string, System.Func<GameObject>>();
        creationTable.Add("factory", createFactory);
        creationTable.Add ("city", createCity);
        creationTable.Add ("fort", createFort);
        creationTable.Add ("barracks", createBarracks);
        creationTable.Add ("tree", createTree);

        team1 = new Dictionary<string, string>();
        team2 = new Dictionary<string, string>();

        team1.Add ("scout", "lambo");
        team1.Add ("ranged", "archer");
        team1.Add ("healer", "healer");
        team1.Add ("medium", "construction");
        team1.Add ("heavy", "predator");

        team2.Add ("scout", "normandy");
        team2.Add ("ranged", "wizard");
        team2.Add ("healer", "healer");
        team2.Add ("medium", "construction");
        team2.Add ("heavy", "centurion");
    }
示例#9
0
 /// <summary>
 /// Returns the object factory stored in this instance
 /// </summary>
 /// <returns>Returns an ObjectFactory object</returns>
 public static ObjectFactory GetObjectFactory()
 {
     if (_objectFactory == null)
     {
         _objectFactory = new ObjectFactory();
     }
     return _objectFactory;
 }
示例#10
0
        public void AbstractConstructor()
        {
            IObjectFactory objectFactory = new ObjectFactory(true);

            IFactory factory = objectFactory.CreateFactory(typeof (Document), Type.EmptyTypes );

            Assert.Throws<ProbeException>(delegate { object obj = factory.CreateInstance(null); });
        }
示例#11
0
		public void DevivedClassConstructor()
		{
			IObjectFactory objectFactory = new ObjectFactory(true);

			IFactory factory = objectFactory.CreateFactory(typeof (Book), Type.EmptyTypes );

			Assert.IsNotNull(factory);
		}
示例#12
0
		public void AbstractConstructor()
		{
			IObjectFactory objectFactory = new ObjectFactory(true);

			IFactory factory = objectFactory.CreateFactory(typeof (Document), Type.EmptyTypes );

            object obj = factory.CreateInstance(null);
		}
示例#13
0
        public void NoMatchConstructor()
        {
            IObjectFactory objectFactory = new ObjectFactory(true);

            IFactory factory = objectFactory.CreateFactory(typeof(ItemBis), Type.EmptyTypes);

            object obj = factory.CreateInstance(null);
        }
示例#14
0
		public void PrivateConstructor()
		{
			IObjectFactory objectFactory = new ObjectFactory(true);

			IFactory factory = objectFactory.CreateFactory(typeof (Order), Type.EmptyTypes );

			object obj = factory.CreateInstance(null);
		}
 public void Should_return_null_from_GetObject_after_DisposeObjects_is_called()
 {
     ObjectFactory objectFactory = new ObjectFactory();
     objectFactory.AddClass(typeof(Dummy));
     objectFactory.CreateObjects();
     Assert.That(objectFactory.GetObject(typeof(Dummy)), Is.Not.Null);
     objectFactory.DisposeObjects();
     Assert.That(objectFactory.GetObject(typeof(Dummy)), Is.Null);
 }
示例#16
0
 public void Invoke_should_throw_when_method_throws()
 {
     ObjectFactory objectFactory = new ObjectFactory();
     objectFactory.AddClass(typeof(ValidHooks));
     objectFactory.CreateObjects();
     var method = Reflection.GetMethod(typeof(ValidHooks), "ThrowsException");
     var hook = new Hook(method);
     hook.Invoke(objectFactory);
 }
示例#17
0
 public void Should_invoke_method_successfully()
 {
     ObjectFactory objectFactory = new ObjectFactory();
     objectFactory.AddClass(typeof(ValidHooks));
     objectFactory.CreateObjects();
     var method = Reflection.GetMethod(typeof(ValidHooks), "Before1");
     var hook = new Hook(method);
     hook.Invoke(objectFactory);
 }
        /// <inheritdoc />
        public IHandler CreateHandler(IObjectDependencyResolver dependencyResolver, Type contractType, Type objectType, PropertySet properties)
        {
            if (! contractType.IsAssignableFrom(objectType))
                throw new RuntimeException(string.Format("Could not satisfy contract of type '{0}' by creating an instance of type '{1}'.",
                    contractType, objectType));

            var objectFactory = new ObjectFactory(dependencyResolver, objectType, properties);
            return new SingletonHandler(objectFactory);
        }
示例#19
0
		public void ProtectedConstructor()
		{
			IObjectFactory objectFactory = new ObjectFactory(true);

			IFactory factory = objectFactory.CreateFactory(typeof (Item), Type.EmptyTypes );

			object obj = factory.CreateInstance(null);

			Assert.IsTrue(obj is Item);
		}
示例#20
0
        public Processor(Loader loader, ObjectFactory objectFactory)
        {
            _loader = loader;
            _objectFactory = objectFactory;
            _repository = _loader.Load();

            // Register TypeConverter for Cuke4Nuke.Framework.Table
            TypeConverterAttribute attr = new TypeConverterAttribute(typeof(TableConverter));
            TypeDescriptor.AddAttributes(typeof(Table), new Attribute[] { attr });
        }
示例#21
0
            public void CreateInstance_WhenComponentHasNoDependencies_InstantiatesItUsingDefaultConstructor()
            {
                var dependencyResolver = MockRepository.GenerateMock<IObjectDependencyResolver>();
                var objectFactory = new ObjectFactory(dependencyResolver, typeof(Component), new PropertySet());

                var component = (Component)objectFactory.CreateInstance();
                Assert.IsNotNull(component);

                dependencyResolver.VerifyAllExpectations();
            }
示例#22
0
        static void Main(string[] args)
        {
            var options = new Options(args);
            var objectFactory = new ObjectFactory();
            var loader = new Loader(options.AssemblyPaths, objectFactory);
            var processor = new Processor(loader, objectFactory);
            var listener = new Listener(processor, options.Port);
            log4net.Config.XmlConfigurator.Configure();

            new NukeServer(listener, options).Start();
        }
 public static ObjectFactory Instance(string fileName)
 {
     if (instance == null)
     {
         lock (lockHelper)
         {
             instance = instance ?? new ObjectFactory(fileName);
         }
     }
     return instance;
 }
示例#24
0
            public void CreateInstance_WhenComponentHasRequiredDependencyWithNoParameterValueAndItIsSatisfied_BuildsTheObjectWithTheResolvedDependency()
            {
                var dependencyResolver = MockRepository.GenerateMock<IObjectDependencyResolver>();
                var objectFactory = new ObjectFactory(dependencyResolver, typeof(ComponentWithRequiredDependencyOnService), new PropertySet());
                var service = MockRepository.GenerateStub<IService>();
                dependencyResolver.Expect(x => x.ResolveDependency("service", typeof(IService), null)).Return(DependencyResolution.Satisfied(service));

                var component = (ComponentWithRequiredDependencyOnService)objectFactory.CreateInstance();
                Assert.AreSame(service, component.Service);

                dependencyResolver.VerifyAllExpectations();
            }
 void Awake()
 {
     if(!Instance)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(this); //Not sure if this will work
     }
 }
示例#26
0
        WorldPhysics worldPhysics = WorldPhysics.DefaultWorldPhysics; //Physics object used on this map. Attributes may be specified in the map file.

        #endregion Fields

        #region Constructors

        //Construct a levelstate object
        public LevelState(Game game, PlayerState player, string mapName)
            : base(game, player)
        {
            Activated += delegate {
                game.Display.Renderer.SetFont("verdana", 8);
            };

            playerInfo = player;

            this.game = game;
            this.display = game.Display;
            this.mapName = mapName;
            //			game.Display.CameraX = 50;
            //game.Display.CameraY = 100;

            //Load map
            MapDescriptor map = game.Resources.GetMapDescriptor(mapName);
            objectFactory = new ObjectFactory(game, this);

            tileMap = new TileMap(game.Display, game.Resources, map);

            //And set up the world physics attributes
            if (map.ExtraProperties.ContainsKey("gravity"))
                worldPhysics.Gravity = double.Parse(map.ExtraProperties["gravity"]);
            if (map.ExtraProperties.ContainsKey("ground-friction-factor"))
                worldPhysics.GroundFrictionFactor = double.Parse(map.ExtraProperties["ground-friction-factor"]);

            //Spawn all objects
            foreach (var o in map.Objects)
            {
                GameObject obj = objectFactory.Spawn(o.Name, new Vector(o.X, o.Y), new Vector(0,-100), worldPhysics);
                if (obj != null)
                {
                    objects.Add(obj);
                    if (o.Name == "mario")
                    {
                        this.player = (Player)objects[objects.Count-1];
                    }
                }
            }

            //Set the map background
            if (!string.IsNullOrEmpty(map.Background))
                background = new ParallaxBackground(game.Resources.GetTexture(map.Background), 0.5, 0.2, game.Display);

            camera = new Camera(display, 0, map.Width * map.TileSize, 0, map.Height * map.TileSize);

            game.Audio.PlayMusic("overworld-intro", "overworld");

            icons["coin"] = objectFactory.CreateIcon("coin", 0.7); //new Icon(game, Helpers.
            icons["mario"] = objectFactory.CreateIcon("mario-big", 0.5); //new Icon(game, marioIcon);
        }
        public void ThenTheListMustWorkWithStringLists()
        {
            using (var rand = new TestDataRandomizer())
            {
                var jToken = JToken.Parse(nativeListJson);
                var listSampler = new ObjectFactory().Create(jToken) as ListSampler;

                Assert.IsNotNull(listSampler, "The listSampler did not get created");

                var item = listSampler.GetItem();
                Assert.AreEqual("Bar", item, "The expected field was not returned by the sampler ([1])");
            }
        }
        public void ThenTheListMustSampleRandomly()
        {
            using (new InjectObjectFactoryContext(Context))
            using (var rand = new TestDataRandomizer())
            {
                var jToken = JToken.Parse(referenceListJson);
                var listSampler = new ObjectFactory().Create(jToken) as ListSampler;

                Assert.IsNotNull(listSampler, "The listSampler did not get created");

                var item = listSampler.GetItem();
                Assert.AreEqual("RandomInt", rand.LastCalled, "The list sampler should be using the randomizer");

            }
        }
示例#29
0
文件: Hook.cs 项目: Jonsey/Cuke4Nuke
 public void Invoke(ObjectFactory objectFactory)
 {
     try
     {
         object instance = null;
         if (!Method.IsStatic)
         {
             instance = objectFactory.GetObject(Method.DeclaringType);
         }
         Method.Invoke(instance, null);
     }
     catch (TargetInvocationException ex)
     {
         throw ex.InnerException;
     }
 }
示例#30
0
        static void Main(string[] args)
        {
            ObjectFactory factory = new ObjectFactory();

            IFlyweightable obj = factory.GetObject("ConcreteObject1");
            obj.Print();
            obj = factory.GetObject("ConcreteObject2");
            obj.Print();
            obj = factory.GetObject("ConcreteObject1");
            obj.Print();
            obj = factory.GetObject("ConcreteObject2");
            obj.Print();

            Console.WriteLine(String.Format("Amount of created objects: {0}", factory.CreatedObjectsAmount));

            Console.ReadLine();
        }
 public override object Deserialize(XmlElement result)
 {
     return(ObjectFactory.Create <PlayReadyLicenseDetails>(result));
 }
 public override object Deserialize(XmlElement result)
 {
     return(ObjectFactory.Create <PlayReadyContentKey>(result));
 }
示例#33
0
 public DrmPolicy(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = ParseInt(node["id"].Value <string>());
     }
     if (node["partnerId"] != null)
     {
         this._PartnerId = ParseInt(node["partnerId"].Value <string>());
     }
     if (node["name"] != null)
     {
         this._Name = node["name"].Value <string>();
     }
     if (node["systemName"] != null)
     {
         this._SystemName = node["systemName"].Value <string>();
     }
     if (node["description"] != null)
     {
         this._Description = node["description"].Value <string>();
     }
     if (node["provider"] != null)
     {
         this._Provider = (DrmProviderType)StringEnum.Parse(typeof(DrmProviderType), node["provider"].Value <string>());
     }
     if (node["status"] != null)
     {
         this._Status = (DrmPolicyStatus)ParseEnum(typeof(DrmPolicyStatus), node["status"].Value <string>());
     }
     if (node["scenario"] != null)
     {
         this._Scenario = (DrmLicenseScenario)StringEnum.Parse(typeof(DrmLicenseScenario), node["scenario"].Value <string>());
     }
     if (node["licenseType"] != null)
     {
         this._LicenseType = (DrmLicenseType)StringEnum.Parse(typeof(DrmLicenseType), node["licenseType"].Value <string>());
     }
     if (node["licenseExpirationPolicy"] != null)
     {
         this._LicenseExpirationPolicy = (DrmLicenseExpirationPolicy)ParseEnum(typeof(DrmLicenseExpirationPolicy), node["licenseExpirationPolicy"].Value <string>());
     }
     if (node["duration"] != null)
     {
         this._Duration = ParseInt(node["duration"].Value <string>());
     }
     if (node["createdAt"] != null)
     {
         this._CreatedAt = ParseInt(node["createdAt"].Value <string>());
     }
     if (node["updatedAt"] != null)
     {
         this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>());
     }
     if (node["licenseParams"] != null)
     {
         this._LicenseParams = new List <KeyValue>();
         foreach (var arrayNode in node["licenseParams"].Children())
         {
             this._LicenseParams.Add(ObjectFactory.Create <KeyValue>(arrayNode));
         }
     }
 }
示例#34
0
 protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
 {
     return ObjectFactory.GetInstance(controllerType) as Controller;
 }
 public DefaultHubCommunicator()
 {
     _restfulServiceClient = ObjectFactory.GetInstance <IRestfulServiceClient>();
     _crate       = ObjectFactory.GetInstance <ICrateManager>();
     _hmacService = ObjectFactory.GetInstance <IHMACService>();
 }
    private void Init_Menu()
    {
        IPatientHome PatientHome = (IPatientHome)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientHome, BusinessProcess.Clinical");
        int          ModuleId    = Convert.ToInt32(Session["TechnicalAreaId"]);
        DataSet      theDS       = PatientHome.GetTechnicalAreaandFormName(ModuleId);

        ViewState["AddForms"] = theDS;

        if (Convert.ToInt32(Session["PatientId"]) != 0)
        {
            PatientId = Convert.ToInt32(Session["PatientId"]);
        }

        if (PatientId == 0)
        {
            PatientId = Convert.ToInt32(Session["PatientId"]);
        }

        if (Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }

        lblversion.Text = AuthenticationManager.AppVersion;
        lblrelDate.Text = AuthenticationManager.ReleaseDate;

        DataTable dtPatientInfo = (DataTable)Session["PatientInformation"];

        if (dtPatientInfo != null && dtPatientInfo.Rows.Count > 0)
        {
            PMTCTNos = dtPatientInfo.Rows[0]["ANCNumber"].ToString() + dtPatientInfo.Rows[0]["PMTCTNumber"].ToString() + dtPatientInfo.Rows[0]["AdmissionNumber"].ToString() + dtPatientInfo.Rows[0]["OutpatientNumber"].ToString();
            ARTNos   = dtPatientInfo.Rows[0]["PatientEnrollmentId"].ToString();
        }
        ////DataTable theDT1 = (DataTable)Session["AppModule"];
        ////DataView theDV = new DataView(theDT1);

        //################  Master Settings ###################
        string UserID = "";

        if (Session["AppUserID"].ToString() != null)
        {
            UserID = Session["AppUserId"].ToString();
        }
        if (Session["AppUserName"].ToString() != null)
        {
            lblUserName.Text = Session["AppUserName"].ToString();
        }
        if (Session["AppLocation"].ToString() != null)
        {
            lblLocation.Text = Session["AppLocation"].ToString();
        }

        IIQCareSystem AdminManager;

        AdminManager = (IIQCareSystem)ObjectFactory.CreateInstance("BusinessProcess.Security.BIQCareSystem, BusinessProcess.Security");
        if (Session["AppDateFormat"].ToString() != null)
        {
            lblDate.Text = AdminManager.SystemDate().ToString(Session["AppDateFormat"].ToString());
        }

        //######################################################

        string theUrl;

        //////if (lblpntStatus.Text == "0")
        //////{
        if (Session["PtnPrgStatus"] != null)
        {
            DataTable theStatusDT       = (DataTable)Session["PtnPrgStatus"];
            DataTable theCEntedStatusDT = (DataTable)Session["CEndedStatus"];
            string    PatientExitReason = string.Empty;
            string    PMTCTCareEnded    = string.Empty;
            string    CareEnded         = string.Empty;
            if (theCEntedStatusDT.Rows.Count > 0)
            {
                PatientExitReason = Convert.ToString(theCEntedStatusDT.Rows[0]["PatientExitReason"]);
                PMTCTCareEnded    = Convert.ToString(theCEntedStatusDT.Rows[0]["PMTCTCareEnded"]);
                CareEnded         = Convert.ToString(theCEntedStatusDT.Rows[0]["CareEnded"]);
            }


            //if ((theStatusDT.Rows[0]["PMTCTStatus"].ToString() == "PMTCT Care Ended") || (Session["PMTCTPatientStatus"]!= null && Session["PMTCTPatientStatus"].ToString() == "1"))
            if ((Convert.ToString(theStatusDT.Rows[0]["PMTCTStatus"]) == "PMTCT Care Ended") || (PatientExitReason == "93" && PMTCTCareEnded == "1"))
            {
                PtnPMTCTStatus = 1;
                Session["PMTCTPatientStatus"] = 1;
            }
            else
            {
                PtnPMTCTStatus = 0;
                Session["PMTCTPatientStatus"] = 0;
                //LoggedInUser.PatientStatus = 0;
            }
            //if ((theStatusDT.Rows[0]["ART/PalliativeCare"].ToString() == "Care Ended") || (Session["HIVPatientStatus"]!= null && Session["HIVPatientStatus"].ToString() == "1"))
            if ((Convert.ToString(theStatusDT.Rows[0]["ART/PalliativeCare"]) == "Care Ended") || (PatientExitReason == "93" && CareEnded == "1"))
            {
                PtnARTStatus = 1;
                Session["HIVPatientStatus"] = 1;
            }
            else
            {
                PtnARTStatus = 0;
                Session["HIVPatientStatus"] = 0;
            }
        }
        //////}
        //else
        //{
        //    if (Session["PtnPrgStatus"] != null)
        //    {
        //        DataTable theStatusDT = (DataTable)Session["PtnPrgStatus"];
        //        if (theStatusDT.Rows[0]["PMTCTStatus"].ToString() == "PMTCT Care Ended")
        //        {
        //            PtnPMTCTStatus = 1;
        //            Session["PMTCTPatientStatus"] = 1;

        //        }
        //        else
        //        {
        //            PtnPMTCTStatus = 0;
        //            Session["PMTCTPatientStatus"] = 0;

        //        }
        //        if (theStatusDT.Rows[0]["ART/PalliativeCare"].ToString() == "Care Ended")
        //        {
        //            PtnARTStatus = 1;
        //            Session["HIVPatientStatus"] = 1;

        //        }
        //        else
        //        {
        //            PtnARTStatus = 0;
        //            Session["HIVPatientStatus"] = 0;

        //        }
        //    }


        //}

        if (lblpntStatus.Text == "0" && (PtnARTStatus == 0 || PtnPMTCTStatus == 0))
        //if (PtnARTStatus == 0 || PtnPMTCTStatus == 0)
        {
            if (PtnARTStatus == 0)
            {
                //########### Initial Evaluation ############
                //theUrl = string.Format("{0}&sts={1}", "../ClinicalForms/frmClinical_InitialEvaluation.aspx?name=Add", PtnARTStatus);
                theUrl           = string.Format("{0}", "../ClinicalForms/frmClinical_InitialEvaluation.aspx");
                mnuInitEval.HRef = theUrl;
                //########### ART-FollowUp ############
                //string theUrl18 = string.Format("{0}&sts={1}", "../ClinicalForms/frmClinical_ARTFollowup.aspx?name=Add", PtnARTStatus);
                string theUrl18 = string.Format("{0}", "../ClinicalForms/frmClinical_ARTFollowup.aspx");
                mnuFollowupART.HRef = theUrl18;
                //########### Non-ART Follow-Up #########
                string theUrl1 = string.Format("{0}", "../ClinicalForms/frmClinical_NonARTFollowUp.aspx");
                Session.Remove("ExixstDS1");
                mnuNonARTFollowUp.HRef = theUrl1;
                ////########### HIV Care/ART Encounter #########
                //string theUrl2 = string.Format("{0}", "../ClinicalForms/frmClinical_HIVCareARTCardEncounter.aspx");
                //mnuHIVCareARTEncounter.HRef = theUrl2;
                //########### Contact Tracking ############
                //theUrl = string.Format("{0}", "../Scheduler/frmScheduler_ContactCareTracking.aspx?");
                //mnuContactCare1.HRef = theUrl;
                //########### Patient Record ############
                theUrl = string.Format("{0}&sts={1}", "../ClinicalForms/frmClinical_PatientRecordCTC.aspx?name=Add", PtnARTStatus);
                //mnuPatientRecord.HRef = theUrl;
                //########### Adult Pharmacy ############
                //LoggedInUser.Program = "ART";
                //LoggedInUser.PatientPharmacyId = 0;
                theUrl = string.Format("{0}", "../Pharmacy/frmPharmacyForm.aspx?Prog=ART");
                //theUrl = string.Format("{0}", "../Pharmacy/frmPharmacy_Adult.aspx?Prog=ART");
                mnuAdultPharmacy.HRef = theUrl;
                //########### Pediatric Pharmacy ############
                //theUrl = string.Format("{0}", "../Pharmacy/frmPharmacy_Paediatric.aspx?Prog=ART");
                //mnuPaediatricPharmacy.HRef = theUrl;
                ////########### Pharmacy CTC###############
                theUrl = string.Format("{0}", "../Pharmacy/frmPharmacy_CTC.aspx?Prog=ART");
                //mnuPharmacyCTC.HRef = theUrl;
                //########### Laboratory ############
                theUrl = string.Format("{0}sts={1}", "../Laboratory/frmLabOrder.aspx?", PtnARTStatus);
                string theUrlLabOrder = string.Format("{0}&sts={1}", "../Laboratory/frmLabOrderTests.aspx?name=Add", PtnARTStatus);
                mnuLabOrder.HRef     = theUrl;
                mnuOrderLabTest.HRef = theUrlLabOrder;
                mnuOrderLabTest.Attributes.Add("onclick", "window.open('" + theUrlLabOrder + "','','toolbars=no,location=no,directories=no,dependent=yes,top=100,left=30,maximize=no,resize=no,width=1000,height=500,scrollbars=yes');return false;");
                //########### Home Visit ############
                theUrl            = string.Format("{0}", "../Scheduler/frmScheduler_HomeVisit.aspx");
                mnuHomeVisit.HRef = theUrl;
            }

            if (PtnPMTCTStatus == 0)
            {
                //########### Contact Tracking ############
                theUrl = string.Format("{0}Module={1}", "../Scheduler/frmScheduler_ContactCareTracking.aspx?", "PMTCT");
                //mnuContactCarePMTCT.HRef = theUrl;

                //####### Adult Pharmacy PMTCT ##########
                //LoggedInUser.Program = "PMTCT";
                //LoggedInUser.PatientPharmacyId = 0;
                theUrl = string.Format("{0}", "../Pharmacy/frmPharmacyForm.aspx?Prog=PMTCT");
                mnuAdultPharmacyPMTCT.HRef = theUrl;

                //###########Paediatric Pharmacy PMTCT#################
                //theUrl = string.Format("{0}", "../Pharmacy/frmPharmacy_Paediatric.aspx?Prog=PMTCT");
                //mnuPaediatricPharmacyPMTCT.HRef = theUrl;

                //########### Pharmacy PMTCT CTC###############
                theUrl = string.Format("{0}", "../Pharmacy/frmPharmacy_CTC.aspx?Prog=PMTCT");
                //mnuPharmacyPMTCTCTC.HRef = theUrl;

                //########### Laboratory ############
                string theUrlPMTCT         = string.Format("{0}sts={1}", "../Laboratory/frmLabOrder.aspx?", PtnPMTCTStatus);
                string theUrlPMTCTLabOrder = string.Format("{0}sts={1}", "../Laboratory/frmLabOrderTests.aspx?", PtnPMTCTStatus);
                mnuLabOrderPMTCT.HRef     = theUrlPMTCT;
                mnuOrderLabTestPMTCT.HRef = theUrlPMTCTLabOrder;
                mnuOrderLabTestPMTCT.Attributes.Add("onclick", "window.open('" + theUrlPMTCTLabOrder + "','','toolbars=no,location=no,directories=no,dependent=yes,top=100,left=30,maximize=no,resize=no,width=1000,height=500,scrollbars=yes');return false;");
            }
        }

        #region "Common Forms"
        theUrl = string.Format("{0}&mnuClicked={1}&sts={2}", "../AdminForms/frmAdmin_DeletePatient.aspx?name=Add", "DeletePatient", lblpntStatus.Text);
        mnuAdminDeletePatient.HRef = theUrl;

        //######## Meetu 08 Sep 2009 End########//
        //####### Delete Form #############
        theUrl = string.Format("{0}?sts={1}", "../ClinicalForms/frmClinical_DeleteForm.aspx", lblpntStatus.Text);
        mnuClinicalDeleteForm.HRef = theUrl;

        //####### Delete Patient  #############
        //theUrl = string.Format("{0}?mnuClicked={1}&sts={2}", "../frmFindAddPatient.aspx?name=Add", "DeletePatient", lblpntStatus.Text);
        theUrl = string.Format("{0}?mnuClicked={1}&sts={2}&PatientID={3}", "../AdminForms/frmAdmin_DeletePatient.aspx?name=Add", "DeletePatient", lblpntStatus.Text, PatientId.ToString());
        mnuAdminDeletePatient.HRef = theUrl;

        //##### Patient Transfer #######
        //theUrl = string.Format("{0}&PatientId={1}&sts={2}", "../ClinicalForms/frmClinical_Transfer.aspx?name=Add", PatientId.ToString(), lblpntStatus.Text);
        theUrl = string.Format("{0}&sts={1}", "../ClinicalForms/frmClinical_Transfer.aspx?name=Add", lblpntStatus.Text);

        mnuPatientTranfer.HRef = theUrl;

        //########### Existing Forms ############
        theUrl = string.Format("{0}", "../ClinicalForms/frmPatient_History.aspx");
        mnuExistingForms.HRef = theUrl;

        //########### ARV-Pickup Report ############
        theUrl             = string.Format("{0}&SatelliteID={1}&CountryID={2}&PosID={3}&sts={4}", "../Reports/frmReport_PatientARVPickup.aspx?name=Add", Session["AppSatelliteId"], Session["AppCountryId"], Session["AppPosID"], lblpntStatus.Text);
        mnuDrugPickUp.HRef = theUrl;

        //########### PatientProfile ############
        theUrl = string.Format("{0}&ReportName={1}&sts={2}", "../Reports/frmReportViewer.aspx?name=Add", "PatientProfile", lblpntStatus.Text);
        mnuPatientProfile.HRef = theUrl;

        //########### ARV-Pickup Report ############
        theUrl            = string.Format("{0}&SatelliteID={1}&CountryID={2}&PosID={3}&sts={4}", "../Reports/frmReportDebitNote.aspx?name=Add", Session["AppSatelliteId"], Session["AppCountryId"], Session["AppPosID"], lblpntStatus.Text);
        mnuDebitNote.HRef = theUrl;

        ////////########### Patient Blue Cart############
        //////theUrl = string.Format("{0}&PatientId={1}&ReportName={2}&sts={3}", "../Reports/frmPatientBlueCart.aspx?name=Add", PatientId.ToString(), "PatientProfile", lblpntStatus.Text);
        //////mnupatientbluecart.HRef = theUrl;


        //###### PatientHome #############
        ////theUrl = string.Format("{0}?PatientId={1}", "../ClinicalForms/frmPatient_Home.aspx", PatientId.ToString());
        theUrl             = string.Format("{0}", "../ClinicalForms/frmPatient_Home.aspx");
        mnuPatienHome.HRef = theUrl;

        //###### Scheduler #############
        theUrl = string.Format("{0}&LocationId={1}&FormName={2}&sts={3}", "../Scheduler/frmScheduler_AppointmentHistory.aspx?name=Add", Session["AppLocationId"].ToString(), "PatientHome", lblpntStatus.Text);
        mnuScheduleAppointment.HRef = theUrl;

        //####### Additional Forms - Family Information #######
        theUrl = string.Format("{0}", "../ClinicalForms/frmFamilyInformation.aspx?name=Add");
        mnuFamilyInformation.HRef = theUrl;

        //####### Patient Classification #######
        theUrl = string.Format("{0}", "../ClinicalForms/frmClinical_PatientClassificationCTC.aspx?name=Add");
        mnuPatientClassification.HRef = theUrl;

        //####### Follow-up Education #######
        theUrl = string.Format("{0}", "../ClinicalForms/frmFollowUpEducationCTC.aspx?name=Add");
        mnuFollowupEducation.HRef = theUrl;

        //####### Exposed Infant #############
        theUrl = string.Format("{0}", "../ClinicalForms/frmExposedInfantEnrollment.aspx");
        mnuExposedInfant.HRef = theUrl;
        #endregion
        theUrl = string.Format("{0}", "../ClinicalForms/frm_PriorArt_HivCare.aspx");
        mnuPriorARTHIVCare.HRef = theUrl;
        theUrl          = string.Format("{0}", "../ClinicalForms/frmClinical_ARTCare.aspx");
        mnuARTCare.HRef = theUrl;

        //########### HIV Care/ART Encounter #########
        string theUrl2 = string.Format("{0}", "../ClinicalForms/frmClinical_HIVCareARTCardEncounter.aspx");
        mnuHIVCareARTEncounter.HRef = theUrl2;

        //########### Kenya Blue Card #########
        theUrl           = string.Format("{0}", "../ClinicalForms/frmClinical_InitialFollowupVisit.aspx");
        mnuARTVisit.HRef = theUrl;

        theUrl             = string.Format("{0}", "../ClinicalForms/frmClinical_ARVTherapy.aspx");
        mnuARTTherapy.HRef = theUrl;

        //theUrl = string.Format("{0}?PatientId={1}", "../ClinicalForms/frmClinical_ARTHistory.aspx", PatientId.ToString());
        //mnuARTTherapy.HRef = theUrl;

        theUrl             = string.Format("{0}", "../ClinicalForms/frmClinical_ARTHistory.aspx");
        mnuARTHistory.HRef = theUrl;

        //########### Patient Enrollment ############
        //Added - Jayanta Kr. Das - 16-02-07
        DataTable theDT = new DataTable();
        if (PatientId != 0)
        {
            //### Patient Enrolment ######
            string theUrl1 = "";
            if (ARTNos != null && ARTNos == "")
            {
                if (Session["SystemId"].ToString() == "1" && PtnARTStatus == 0)
                {
                    ////theUrl = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_Enrolment.aspx?name=Add", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnARTStatus);
                    theUrl            = string.Format("{0}", "../ClinicalForms/frmClinical_Enrolment.aspx");
                    mnuEnrolment.HRef = theUrl;
                }
                else if (PtnARTStatus == 0)
                {
                    theUrl            = string.Format("{0}&locationid={1}&sts={2}", "../ClinicalForms/frmClinical_PatientRegistrationCTC.aspx?name=Add", Session["AppLocationId"].ToString(), PtnARTStatus);
                    mnuEnrolment.HRef = theUrl;
                }
                if (PtnPMTCTStatus == 0)
                {
                    ////theUrl1 = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_EnrolmentPMTCT.aspx?name=Edit", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnPMTCTStatus);
                    //theUrl1 = string.Format("{0}", "../frmPatientRegistration.aspx"); //JAYANT 25/4/2012
                    theUrl1            = string.Format("{0}", "../frmPatientCustomRegistration.aspx");
                    mnuPMTCTEnrol.HRef = theUrl1;
                }
            }

            else if (PMTCTNos != null && PMTCTNos == "")
            {
                if (PtnPMTCTStatus == 0)
                {
                    ////theUrl1 = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_EnrolmentPMTCT.aspx?name=Add", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnPMTCTStatus);
                    //theUrl1 = string.Format("{0}", "../frmPatientRegistration.aspx");
                    theUrl1            = string.Format("{0}", "../frmPatientCustomRegistration.aspx");
                    mnuPMTCTEnrol.HRef = theUrl1;
                }

                if (Session["SystemId"].ToString() == "1" && PtnARTStatus == 0)
                {
                    theUrl            = string.Format("{0}", "../ClinicalForms/frmClinical_Enrolment.aspx");
                    mnuEnrolment.HRef = theUrl;
                }
                else if (PtnARTStatus == 0)
                {
                    theUrl            = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_PatientRegistrationCTC.aspx?name=Edit", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnARTStatus);
                    mnuEnrolment.HRef = theUrl;
                }
            }
            else
            {
                //if (PtnPMTCTStatus == 0)
                //{
                ////theUrl1 = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_EnrolmentPMTCT.aspx?name=Edit", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnPMTCTStatus);
                //theUrl1 = string.Format("{0}", "../frmPatientRegistration.aspx");
                theUrl1            = string.Format("{0}", "../frmPatientCustomRegistration.aspx");
                mnuPMTCTEnrol.HRef = theUrl1;
                //}

                if (Session["SystemId"].ToString() == "1" && PtnARTStatus == 0)
                {
                    ////theUrl = string.Format("{0}&patientid={1}&locationid={2}&sts={3}", "../ClinicalForms/frmClinical_Enrolment.aspx?name=Edit", PatientId.ToString(), Session["AppLocationId"].ToString(), PtnARTStatus);
                    theUrl            = string.Format("{0}", "../ClinicalForms/frmClinical_Enrolment.aspx");
                    mnuEnrolment.HRef = theUrl;
                }
                else if (PtnARTStatus == 0)
                {
                    theUrl            = string.Format("{0}&locationid={1}&sts={2}", "../ClinicalForms/frmClinical_PatientRegistrationCTC.aspx?name=Edit", Session["AppLocationId"].ToString(), PtnARTStatus);
                    mnuEnrolment.HRef = theUrl;
                }
            }
        }
        //Load_MenuPartial(PatientId, PtnPMTCTStatus.ToString(), Convert.ToInt32(Session["AppCurrency"].ToString()));
    }
示例#37
0
        public static TwinsKey CreateNew(int depth = 0)
        {
            rt.srz.model.srz.TwinsKey entity = new rt.srz.model.srz.TwinsKey();

            // You may need to maually enter this key if there is a constraint violation.
            entity.Id = System.Guid.NewGuid();


            using (rt.srz.business.manager.ISearchKeyTypeManager searchKeyTypeManager = ObjectFactory.GetInstance <ISearchKeyTypeManager>())
            {
                entity.KeyType = null;
            }

            using (rt.srz.business.manager.ITwinManager twinManager = ObjectFactory.GetInstance <ITwinManager>())
            {
                entity.Twin = null;
            }

            return(entity);
        }
示例#38
0
        public DataTable loadPatientLatestPharmacyPrescription(string PatientID, string FacilityID)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getLatestPharmacyPrescriptionDetails(PatientID, FacilityID));
        }
示例#39
0
        public DataTable getPharmacyDrugList(string PMSCM, string treatmentPlan)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyDrugList(PMSCM, treatmentPlan));
        }
示例#40
0
 public override void SetUp()
 {
     base.SetUp();
     _userService = ObjectFactory.GetInstance <Fr8Account>();
 }
示例#41
0
        public List <PharmacyFields> getPharmacyCurrentRegimen(string patientId)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyCurrentRegimen(patientId));
        }
示例#42
0
        public List <DrugBatch> getPharmacyDrugBatch(string drugPk)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyDrugBatch(drugPk));
        }
示例#43
0
        public DataTable getPharmacyDrugSwitchInterruptionReason(string treatmentPlan)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyDrugSubstitutionInterruptionReason(treatmentPlan));
        }
示例#44
0
        /// <summary>
        /// Searches the specified query.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <param name="skip">The skip.</param>
        /// <param name="take">The take.</param>
        /// <param name="hitCount">The hit count.</param>
        /// <returns></returns>
        public IEnumerable <IDocument> Search(string query, string language, int skip, int take, out int hitCount)
        {
            var service          = Telerik.Sitefinity.Services.ServiceBus.ResolveService <ISearchService>();
            var queryBuilder     = ObjectFactory.Resolve <IQueryBuilder>();
            var config           = Config.Get <SearchConfig>();
            var enableExactMatch = config.EnableExactMatch;

            var searchQuery = queryBuilder.BuildQuery(query, this.SearchFields);

            searchQuery.IndexName         = this.IndexCatalogue;
            searchQuery.Skip              = skip;
            searchQuery.Take              = take;
            searchQuery.OrderBy           = this.GetOrderList();
            searchQuery.EnableExactMatch  = enableExactMatch;
            searchQuery.HighlightedFields = this.HighlightedFields;

            ISearchFilter filter;

            if (this.TryBuildLanguageFilter(language, out filter))
            {
                searchQuery.Filter = filter;
            }

            var oldSkipValue     = skip;
            var permissionFilter = config.EnableFilterByViewPermissions;

            if (permissionFilter)
            {
                Func <int, int, IEnumerable <Document> > searchResults = delegate(int querySkip, int queryTake)
                {
                    searchQuery.Skip = querySkip;
                    searchQuery.Take = queryTake;
                    var results = service.Search(searchQuery);

                    return(results.OfType <Document>());
                };

                var loader = new FilteredDataItemsLoader <Document>(searchResults);

                bool hasMoreItems = false;
                var  items        = loader.ValidateDataItems <Document>(PermissionsFilter.PermissionAction.View, out hasMoreItems, take, skip, (i, j) => i);

                oldSkipValue++;

                // Value will always show one more, when hasMoreItems is true. It also be at least one.
                if (hasMoreItems)
                {
                    hitCount = items.Count() + oldSkipValue;
                }
                else
                {
                    if (skip == 0 && take == int.MaxValue)
                    {
                        hitCount = items.Count();
                    }
                    else
                    {
                        hitCount = oldSkipValue;
                    }
                }

                return(items.Cast <IDocument>().SetContentLinks());
            }
            else
            {
                IResultSet result = service.Search(searchQuery);
                hitCount = result.HitCount;

                return(result.SetContentLinks());
            }
        }
 public override object Deserialize(XmlElement result)
 {
     return(ObjectFactory.Create <ScheduledTaskProfile>(result));
 }
示例#46
0
        public DataTable loadPatientEncounterDiagnosis(string PatientMasterVisitID, string PatientID)
        {
            IPatientEncounter patientEncounter = (IPatientEncounter)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientEncounter, BusinessProcess.CCC");

            return(patientEncounter.getPatientEncounterDiagnosis(PatientMasterVisitID, PatientID));
        }
 public override object Deserialize(XmlElement result)
 {
     return(ObjectFactory.Create <ListResponse <ObjectBase> >(result));
 }
示例#48
0
 public override object Deserialize(JToken result)
 {
     return(ObjectFactory.Create <DrmPolicy>(result));
 }
示例#49
0
        /// <summary>
        /// 获取IBE数据
        /// </summary>
        /// <param name="FromCode"></param>
        /// <param name="ToCode"></param>
        /// <param name="FlyDate"></param>
        /// <returns></returns>
        public AVHData GetAvh(string FromCode, string ToCode, DateTime FlyDate, string carrayCode)
        {
            AVHData ibeData = new AVHData();
            //记录日志
            StringBuilder sbLog = new StringBuilder();

            sbLog.Append("参数:\r\nFromCode=" + FromCode + "\r\n ToCode=" + ToCode + "\r\n FlyDate=" + FlyDate.ToString("yyyy-MM-dd HH:mm:ss") + (carrayCode != null ? carrayCode : ""));
            try
            {
                ibeData.IbeData    = new List <IBERow>();
                ibeData.QueryParam = new QueryParam()
                {
                    FromCode = FromCode,
                    ToCode   = ToCode,
                    FlyDate  = FlyDate.ToString("yyy-MM-dd"),
                    FlyTime  = "00:00:00"
                };
                string strData = string.Empty;
                if (useProxyQuery == 0)
                {
                    IBEService.WebService1SoapClient ibe = new IBEService.WebService1SoapClient();
                    strData = ibe.getIBEAVData(ibeData.QueryParam.FromCode, ibeData.QueryParam.ToCode, ibeData.QueryParam.FlyDate, ibeData.QueryParam.FlyTime);
                }
                else if (useProxyQuery == 1)
                {
                    FlightService flightService = ObjectFactory.GetInstance <FlightService>();
                    strData = flightService.GetAV(this.QueryParam.Code, ibeData.QueryParam.FromCode, ibeData.QueryParam.ToCode, carrayCode, ibeData.QueryParam.FlyDate, "0000");
                }
                ibeData.AVHString = strData;
                if (!strData.Contains("NoRoutingException"))
                {
                    string[] IbeArray = strData.Split(new string[] { "^" }, StringSplitOptions.RemoveEmptyEntries);
                    if (IbeArray != null && IbeArray.Length > 0)
                    {
                        string[] strRow = null;
                        foreach (string row in IbeArray)
                        {
                            strRow = row.ToUpper().Split(',');
                            if (strRow.Length >= 15)
                            {
                                IBERow ibeRow = new IBERow();
                                try
                                {
                                    //检测日期格式是否正确
                                    DateTime.Parse(strRow[0]);
                                }
                                catch
                                {
                                    strRow[0] = ibeData.QueryParam.FlyDate;
                                }
                                ibeRow.FlyDate     = strRow[0];
                                ibeRow.StartTime   = strRow[1];
                                ibeRow.EndTime     = strRow[2];
                                ibeRow.CarrierCode = strRow[3].Trim(new char[] { '*' });
                                //过滤航空公司
                                if (!string.IsNullOrEmpty(carrayCode))
                                {
                                    if (ibeRow.CarrierCode != carrayCode.ToUpper())
                                    {
                                        continue;
                                    }
                                }
                                ibeRow.FlightNo = strRow[4].Trim(new char[] { '*' });
                                if (!string.IsNullOrEmpty(strRow[5]) && strRow[5].Split('*')[0].Trim() != "")
                                {
                                    string          strSeat = strRow[5].Split('*')[0].Trim();
                                    string          pattern = "((?<Seat>[0-9A-Z])(?<SeatSymbol>[0-9A-Z]))";
                                    MatchCollection mchs    = Regex.Matches(strSeat, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
                                    ibeRow.IBESeat = new List <IbeSeat>();
                                    foreach (Match item in mchs)
                                    {
                                        if (item.Success)
                                        {
                                            IbeSeat ibeseat = new IbeSeat();
                                            ibeseat.Seat       = item.Groups["Seat"].Value.Trim();
                                            ibeseat.SeatSymbol = item.Groups["SeatSymbol"].Value.Trim();
                                            if (ibeseat.SeatSymbol == "A")
                                            {
                                                ibeseat.SeatCount = ">9";
                                            }
                                            else if (char.IsNumber(ibeseat.SeatSymbol[0]))
                                            {
                                                ibeseat.SeatCount = ibeseat.SeatSymbol;
                                            }
                                            else
                                            {
                                                ibeseat.SeatCount = "0";
                                            }
                                            //过滤没有位置的舱位
                                            int mSeatCount = 0;
                                            int.TryParse(ibeseat.SeatCount.Replace(">", ""), out mSeatCount);
                                            if (mSeatCount > 0)
                                            {
                                                ibeseat = SetDefaultData(ibeseat);
                                                //去重
                                                if (!ibeRow.IBESeat.Exists(p => p.Seat == ibeseat.Seat))
                                                {
                                                    ibeRow.IBESeat.Add(ibeseat);
                                                }
                                            }
                                        }
                                    }
                                }
                                ibeRow.FromCode           = strRow[6];
                                ibeRow.ToCode             = strRow[7];
                                ibeRow.AirModel           = strRow[8];
                                ibeRow.IsStop             = strRow[9].Trim() == "1" ? true : false;
                                ibeRow.IsMeals            = strRow[10].Trim() == "1" ? true : false;
                                ibeRow.IsElectronicTicket = strRow[11].Trim() == "1" ? true : false;
                                ibeRow.IsShareFlight      = (strRow[12].Trim().ToLower() == "1" || strRow[12].Trim().ToLower() == "true") ? true : false;
                                //处理子舱位
                                ibeRow.ChildSeat = strRow[13].Trim();
                                if (!string.IsNullOrEmpty(ibeRow.ChildSeat))
                                {
                                    string          pattern = "((?<Seat>[0-9A-Z]1)(?<SeatSymbol>[0-9A-Z]))";
                                    MatchCollection mchs    = Regex.Matches(ibeRow.ChildSeat, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
                                    if (ibeRow.IBESeat == null)
                                    {
                                        ibeRow.IBESeat = new List <IbeSeat>();
                                    }
                                    foreach (Match item in mchs)
                                    {
                                        if (item.Success)
                                        {
                                            IbeSeat ibeseat = new IbeSeat();
                                            ibeseat.Seat       = item.Groups["Seat"].Value.Trim();
                                            ibeseat.SeatSymbol = item.Groups["SeatSymbol"].Value.Trim();
                                            if (ibeseat.SeatSymbol == "A")
                                            {
                                                ibeseat.SeatCount = ">9";
                                            }
                                            else if (char.IsNumber(ibeseat.SeatSymbol[0]))
                                            {
                                                ibeseat.SeatCount = ibeseat.SeatSymbol;
                                            }
                                            else
                                            {
                                                ibeseat.SeatCount = "0";
                                            }
                                            //过滤没有位置的舱位
                                            int mSeatCount = 0;
                                            int.TryParse(ibeseat.SeatCount.Replace(">", ""), out mSeatCount);
                                            if (mSeatCount > 0)
                                            {
                                                ibeseat = SetDefaultData(ibeseat);
                                                //去重
                                                if (!ibeRow.IBESeat.Exists(p => p.Seat == ibeseat.Seat))
                                                {
                                                    ibeRow.IBESeat.Add(ibeseat);
                                                }
                                            }
                                        }
                                    }
                                }
                                string strFromCityT1 = strRow[14].Trim();
                                if (strFromCityT1.Length == 2)
                                {
                                    strFromCityT1 = strFromCityT1.Substring(0, 1);
                                }
                                else if (strFromCityT1.Length == 3)
                                {
                                    if (strFromCityT1.StartsWith("D"))
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 1);
                                    }
                                    else
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 2);
                                    }
                                }
                                else
                                {
                                    if ((strFromCityT1.Length >= 2))
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 2);
                                    }
                                }
                                ibeRow.FromCityT1 = getHZL(ibeRow.FromCode, ibeRow.CarrierCode, strFromCityT1);

                                string strToCityT1 = strRow[14].Trim();
                                if (strToCityT1.Length == 2)
                                {
                                    strToCityT1 = strToCityT1.Substring(1, 1);
                                }
                                else if (strToCityT1.Length == 3)
                                {
                                    if (strToCityT1.StartsWith("D"))
                                    {
                                        strToCityT1 = strToCityT1.Substring(1, 2);
                                    }
                                    else
                                    {
                                        strToCityT1 = strToCityT1.Substring(2, 1);
                                    }
                                }
                                else
                                {
                                    if ((strToCityT1.Length >= 4))
                                    {
                                        strToCityT1 = strToCityT1.Substring(2, 2);
                                    }
                                }
                                ibeRow.ToCityT1 = getHZL(ibeRow.ToCode, ibeRow.CarrierCode, strToCityT1);

                                if (ibeRow.IsShareFlight)
                                {
                                    if (IsOpenShareflght)//过滤共享航班
                                    {
                                        //过去完后添加集合
                                        ibeData.IbeData.Add(ibeRow);
                                    }
                                }
                                else
                                {
                                    //添加集合
                                    ibeData.IbeData.Add(ibeRow);
                                }
                            }
                        }
                    }
                }
                else
                {
                    sbLog.Append("IBE异常信息:" + strData + "\r\n");
                }
            }
            catch (Exception ex)
            {
                sbLog.Append("异常信息:" + ex.Message + "\r\n");
                //记录日志
                log.WriteLog("GetAvh", sbLog.ToString());
            }
            return(ibeData);
        }
示例#50
0
    //private void BindCombo()
    //{
    //    IQCareUtils theUtil = new IQCareUtils();
    //    DataTable theDT = theUtil.CreateTimeTable(15);
    //    DataRow theDR = theDT.NewRow();
    //    theDR[0] = "0";
    //    theDR[1] = "Select";
    //    theDT.Rows.InsertAt(theDR, 0);
    //    ddBackupTime.DataSource = theDT;
    //    ddBackupTime.DataTextField = "Time";
    //    ddBackupTime.DataValueField = "Id";
    //    ddBackupTime.DataBind();
    //}

    private void Fill_Details()
    {
        string script;

        /*-------------------Dynamic Label Settings----------------------*/
        //DataTable theDT = ((DataSet)ViewState["FacilityDS"]).Tables[1];
        theFacilityDS = new DataSet();
        AuthenticationManager Authentication = new AuthenticationManager();
        IFacilitySetup        FacilityMaster = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

        theFacilityDS = FacilityMaster.GetFacilityList(Convert.ToInt32(Session["SystemId"]), ApplicationAccess.FacilitySetup, 0);

        DataTable theDT = theFacilityDS.Tables[1];

        lblCountry.InnerText   = theDT.Rows[0]["Label"].ToString() + ":";
        lblPOS.InnerText       = theDT.Rows[1]["Label"].ToString() + ":";
        lblSatellite.InnerText = theDT.Rows[2]["Label"].ToString() + ":";
        /*---------------------------------------------------------------*/

        if (Convert.ToInt32(ViewState["FacilityId"]) > 0)
        {
            DataView theDV = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[0]);
            theDV.RowFilter           = "FacilityId=" + ViewState["FacilityId"].ToString();
            txtfacilityname.Text      = theDV[0]["FacilityName"].ToString();
            txtcountryno.Text         = theDV[0]["CountryId"].ToString();
            txtLPTF.Text              = theDV[0]["PosId"].ToString();
            txtSatelliteID.Text       = theDV[0]["SatelliteId"].ToString();
            txtNationalId.Text        = theDV[0]["NationalId"].ToString();
            txtGrace.Text             = theDV[0]["AppGracePeriod"].ToString();
            ddlprovince.SelectedValue = theDV[0]["provinceId"].ToString();
            ddldistrict.SelectedValue = theDV[0]["DistrictId"].ToString();
            if (theDV[0]["PepFarStartDate"].ToString() != "")
            {
                txtPEPFAR_Fund.Text = ((DateTime)theDV[0]["PepFarStartDate"]).ToString(Session["AppDateFormat"].ToString());
            }
            cmbCurrency.SelectedValue = theDV[0]["Currency"].ToString();
            if (theDV[0]["Status"].ToString() == "Active")
            {
                ddStatus.SelectedValue = "0";
            }
            else if (theDV[0]["Status"].ToString() == "In-Active")
            {
                ddStatus.SelectedValue = "1";
            }
            if (theDV[0]["Preferred"].ToString() == "Yes")
            {
                chkPreferred.Checked = true;
            }
            else
            {
                chkPreferred.Checked = false;
            }

            if (theDV[0]["Paperless"].ToString() == "Yes")
            {
                chkPaperlessclinic.Checked = true;
                ViewState["Paperless"]     = "1";
            }
            else
            {
                chkPaperlessclinic.Checked = false;
                ViewState["Paperless"]     = "0";
            }
            if (theDV[0]["StrongPassFlag"].ToString() == "1")
            {
                chkStrongPwd.Checked = true;
            }
            else
            {
                chkStrongPwd.Checked = false;
            }
            if (theDV[0]["ExpPwdFlag"].ToString() == "1")
            {
                chkexpPwd.Checked = true;
                script            = "";
                script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_0'>\n";
                script           += "show('divnoofdays');\n";
                script           += "</script>\n";
                RegisterStartupScript("ExpNoofDays_0", script);
                txtnoofdays.Text = theDV[0]["ExpPwdDays"].ToString();
            }
            else
            {
                chkexpPwd.Checked = false;
                script            = "";
                script            = "<script language = 'javascript' defer ='defer' id = 'ExpNoofDays_1'>\n";
                script           += "hide('divnoofdays');\n";
                script           += "</script>\n";
                RegisterStartupScript("ExpNoofDays_1", script);
                txtnoofdays.Text = "";
            }
            //deepika
            txtcountryno.Enabled   = true;
            txtLPTF.Enabled        = true;
            txtSatelliteID.Enabled = true;
            //Facility Address
            txtFacAddress.Text    = theDV[0]["FacilityAddress"].ToString();
            txtFacCell.Text       = theDV[0]["FacilityCell"].ToString();
            txtFacEmail.Text      = theDV[0]["FacilityEmail"].ToString();
            txtFacFax.Text        = theDV[0]["FacilityFax"].ToString();
            txtFactele.Text       = theDV[0]["FacilityTel"].ToString();
            txtFacURL.Text        = theDV[0]["FacilityURL"].ToString();
            txtpharmfoottext.Text = theDV[0]["FacilityFooter"].ToString();

            if (theDV[0]["FacilityTemplate"].ToString() == "0")
            {
                Radio1.Checked = true;
            }
            else if (theDV[0]["FacilityTemplate"].ToString() == "1")
            {
                Radio2.Checked = true;
            }

            //PMTCT Binding
            string    strExpr;
            DataRow[] foundRows;
            DataView  theDVmdl = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[2]);
            strExpr   = "FacilityId=" + ViewState["FacilityId"].ToString();
            foundRows = theDVmdl.Table.Select(strExpr);
            if (foundRows.GetUpperBound(0) != -1)
            {
                foreach (DataRow dr in foundRows)
                {
                    for (int i = 0; i < cblPMTCT.Items.Count; i++)
                    {
                        if (cblPMTCT.Items[i].Value == dr[1].ToString())
                        {
                            cblPMTCT.Items[i].Selected = true;
                        }
                    }
                }
            }

            //store Binding
            string    strStore;
            DataRow[] foundRowsStore;
            DataView  theDVStore = new DataView(((DataSet)ViewState["FacilityDS"]).Tables[3]);
            strStore       = "locationid=" + ViewState["FacilityId"].ToString();
            foundRowsStore = theDVStore.Table.Select(strStore);
            if (foundRowsStore.GetUpperBound(0) != -1)
            {
                foreach (DataRow dr in foundRowsStore)
                {
                    for (int i = 0; i < cblStores.Items.Count; i++)
                    {
                        if (cblStores.Items[i].Value == dr[1].ToString())
                        {
                            cblStores.Items[i].Selected = true;
                        }
                    }
                }
            }
        }

        //IFacilitySetup FacilityManager;
        //FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
        //DataSet theDS = FacilityManager.GetFacility();
        //if (theDS.Tables[0].Rows.Count > 0)
        //{
        //    FacilityId = Convert.ToInt32(theDS.Tables[0].Rows[0]["FacilityID"]);
        //    txtfacilityname.Text = theDS.Tables[0].Rows[0]["FacilityName"].ToString();
        //    txtcountryno.Text = theDS.Tables[0].Rows[0]["CountryID"].ToString();
        //    txtLPTF.Text = theDS.Tables[0].Rows[0]["PosID"].ToString();
        //    txtSatelliteID.Text = theDS.Tables[0].Rows[0]["SatelliteID"].ToString();
        //   // ddsatelliteloc.SelectedValue = theDS.Tables[0].Rows[0]["SatelliteID"].ToString();
        //    txtGrace.Text = theDS.Tables[0].Rows[0]["AppGracePeriod"].ToString();
        //    cmbCurrency.SelectedValue = theDS.Tables[0].Rows[0]["Currency"].ToString();
        //    DateTime Pepfardate;
        //    if (theDS.Tables[0].Rows[0]["PepFarStartDate"] != System.DBNull.Value)
        //    {
        //        Pepfardate = Convert.ToDateTime(theDS.Tables[0].Rows[0]["PepFarStartDate"]);
        //        txtPEPFAR_Fund.Text = Pepfardate.ToString(Session["AppDateFormat"].ToString());
        //    }

        //    ddBackupDrive.SelectedValue = theDS.Tables[0].Rows[0]["BackupDrive"].ToString();
        //    //if (theDS.Tables[0].Rows[0]["BackupTime"].ToString() == "00:00:00")
        //    if (theDS.Tables[0].Rows[0]["BackupTime"].ToString() == "")
        //    {
        //        ddBackupTime.SelectedValue = "Select";
        //    }
        //    else { ddBackupTime.SelectedValue = theDS.Tables[0].Rows[0]["BackupTime"].ToString(); }
        //    //FileLoad.Value = theDS.Tables[0].Rows[0]["Image"].ToString();
        //    ViewState["LoginImage"] = theDS.Tables[0].Rows[0]["Image"].ToString();
        //}
        //else
        //{
        //    Session["AppUserId"] = "1";
        //}
    }
示例#51
0
 public override object Deserialize(JToken result)
 {
     return(ObjectFactory.Create <ListResponse <DistributionProvider> >(result));
 }
示例#52
0
 public void SelfTestInitialize()
 {
     ObjectFactory.Initialize(x => x.For <IDatabaseStrategy>().Use <MsSql2008Strategy>());
     ObjectFactory.Inject(connection.Object);
 }
示例#53
0
 protected void Application_EndRequest(object sender, EventArgs e)
 {
     ObjectFactory.ReleaseAndDisposeAllHttpScopedObjects();
 }
示例#54
0
        public void CanEdit_CanNotEditWithInvalidModelState()
        {
            validator.ModelState.AddModelError("Test", "Test");

            Assert.IsFalse(validator.CanEdit(ObjectFactory.CreateRoleView()));
        }
 private static void RunShowCalculationUseCase()
 {
     ObjectFactory.GetInstance <IShowCalculationUseCase>().Run();
 }
示例#56
0
 public void CanCreate_CanCreateValidRole()
 {
     Assert.IsTrue(validator.CanCreate(ObjectFactory.CreateRoleView()));
 }
示例#57
0
    private void Init_Form()
    {
        txtcountryno.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtcountryno.ClientID + "')");
        txtcountryno.Attributes.Add("onblur", "chkPostiveInteger('" + txtcountryno.ClientID + "')");

        txtLPTF.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtLPTF.ClientID + "')");
        txtLPTF.Attributes.Add("onblur", "chkPostiveInteger('" + txtLPTF.ClientID + "')");

        txtSatelliteID.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')");
        txtSatelliteID.Attributes.Add("onblur", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')");
        txtNationalId.Attributes.Add("onKeyup", "chkNumeric('" + txtNationalId.ClientID + "')");

        txtfacilityname.Text      = "";
        txtcountryno.Text         = "";
        txtLPTF.Text              = "";
        txtSatelliteID.Text       = "";
        txtGrace.Text             = "";
        txtPEPFAR_Fund.Text       = "";
        cmbCurrency.SelectedValue = "0";
        if (Session["SystemId"].ToString() == "2")
        {
            paperless.Visible = false;
        }
        //BindCombo();
        //ddBackupTime.SelectedValue = "0";


        BindFunctions BindManager = new BindFunctions();
        IQCareUtils   theUtils    = new IQCareUtils();
        DataSet       theDSXML    = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));

        DataView  theDV = new DataView();
        DataTable theDT = new DataTable();

        /*******/
        theDV           = new DataView(theDSXML.Tables["Mst_District"]);
        theDV.RowFilter = "DeleteFlag=0 and SystemID= " + Session["SystemId"] + "";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddldistrict, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }

        theDV           = new DataView(theDSXML.Tables["Mst_Province"]);
        theDV.RowFilter = "Deleteflag=0 and SystemID=" + Session["SystemId"] + "";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddlprovince, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
        /////////////////////////////////////////////////
        IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
        DataSet        theDSFacility   = FacilityManager.GetModuleName();
        DataTable      DT = theDSFacility.Tables[0];

        BindManager.BindCheckedList(cblPMTCT, DT, "modulename", "moduleid");

        DataTable DTStore = theDSFacility.Tables[2];

        BindManager.BindCheckedList(cblStores, DTStore, "name", "id");
    }
示例#58
0
        public DataTable getPharmacyRegimens(string regimenLine)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyRegimens(regimenLine));
        }
示例#59
0
        public DataTable getPharmacyPendingPrescriptions(string PatientMasterVisitID, string patientID)
        {
            IPatientPharmacy patientEncounter = (IPatientPharmacy)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientPharmacy, BusinessProcess.CCC");

            return(patientEncounter.getPharmacyPendingPrescriptions(PatientMasterVisitID, patientID));
        }
示例#60
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }

        IFacilitySetup FacilityManager;
        IQCareUtils    theUtils = new IQCareUtils();

        if (txtPEPFAR_Fund.Text.Trim() == "")
        {
            txtPEPFAR_Fund.Text = "01-01-1900";
        }
        if (txtPEPFAR_Fund.Text.Trim() != "")
        {
            thePepFarDate = theUtils.MakeDate(txtPEPFAR_Fund.Text);
        }
        try
        {
            if (FileLoad.PostedFile.FileName != "")
            {
                HttpPostedFile theFile = FileLoad.PostedFile;
                theFile.SaveAs(Server.MapPath(string.Format("..//images//{0}", "Login.jpg")));
                theFName = "Login.jpg";
            }
            else if (ViewState["LoginImage"] != null)
            {
                theFName = ViewState["LoginImage"].ToString();
            }
            else
            {
                theFName = "";
            }

            if (chkPreferred.Checked == true)
            {
                Preferred = 1;
            }
            else
            {
                Preferred = 0;
            }

            int Paperless;
            if (chkPaperlessclinic.Checked == true)
            {
                Paperless = 1;
            }
            else
            {
                Paperless = 0;
            }

            DataTable dtModule = AddModule();
            if (Filelogo.PostedFile.FileName != "")
            {
                HttpPostedFile theFilelogo = Filelogo.PostedFile;
                theFilelogo.SaveAs(Server.MapPath(string.Format("..//images//{0}", txtfacilityname.Text + ".jpg")));
            }
            Hashtable htFacilityParameters = new Hashtable();
            htFacilityParameters.Add("FacilityLogo", txtfacilityname.Text + ".jpg");
            htFacilityParameters.Add("FacilityAddress", txtFacAddress.Text);
            htFacilityParameters.Add("FacilityTel", txtFactele.Text);
            htFacilityParameters.Add("FacilityCell", txtFacCell.Text);
            htFacilityParameters.Add("FacilityFax", txtFacFax.Text);
            htFacilityParameters.Add("FacilityEmail", txtFacEmail.Text);
            htFacilityParameters.Add("FacilityFootertext", txtpharmfoottext.Text);
            htFacilityParameters.Add("FacilityURL", txtFacURL.Text);
            htFacilityParameters.Add("Facilitytemplate", this.Radio1.Checked == true ? Radio1.Value.ToString() : (this.Radio2.Checked == true ? Radio2.Value.ToString():"0"));
            htFacilityParameters.Add("StrongPassword", this.chkStrongPwd.Checked == true ? 1 : 0);
            htFacilityParameters.Add("ExpirePaswordFlag", this.chkexpPwd.Checked == true ? 1 : 0);
            htFacilityParameters.Add("ExpirePaswordDays", this.chkexpPwd.Checked == true ? txtnoofdays.Text : "");


            /////////////////////////////////
            if (btnSave.Text == "Save")
            {
                FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

                int Rows = FacilityManager.SaveNewFacility(txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, getCheckBoxListItemValues(cblStores));
                if (Rows > 0)
                {
                    IQCareMsgBox.Show("FacilityMasterSave", this);
                    if (Session["AppUserName"] != "")
                    {
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                    else
                    {
                        Response.Redirect("../frmLogOff.aspx");
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
            else
            {
                int Paperlessclinic = this.chkPaperlessclinic.Checked == true ? 1 : 0;
                //int PMTCTclinic = this.chkPMTCT.Checked == true ? 1 : 0;|| (Convert.ToInt32(ViewState["PMTCT"])!= PMTCTclinic)
                if ((Convert.ToInt32(ViewState["Paperless"]) != Paperlessclinic))
                {
                    SaveYesNoforPaperless();
                }
                else if (Convert.ToInt32(ViewState["Paperless"]) == Paperlessclinic)
                {
                    FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    int Rows = FacilityManager.UpdateFacility(Convert.ToInt32(ViewState["FacilityId"]), txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, getCheckBoxListItemValues(cblStores));
                    if (Rows > 0)
                    {
                        IQCareMsgBox.Show("FacilityMasterUpdate", this);
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
        finally
        {
            FacilityManager = null;
        }
    }