Esempio n. 1
0
 internal BuildManager(GlobalManager globalManager)
 {
     _globalManager = globalManager;
     _connectionManager = new ConnectionManager(globalManager);
     _colorManager = new ColorManager(globalManager);
     _sizeManager = new SizeManager(globalManager);
     _jsonTreeManager = new JsonTreeManager(globalManager);
 }
Esempio n. 2
0
        // This method is private because only authenticated users can see this view.
        public ActionResult Index()
        {
            if (BusinessManager.Instance.GlobalManagers.FindAll().Count == 0)
            {
                ApplicationUserManager userManager = HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
                ApplicationUser user;

                if ((user = userManager.FindByEmail("*****@*****.**")) == null)
                {
                    user = new ApplicationUser
                    {
                        Email = "*****@*****.**",
                        FirstName = "Ricardo",
                        LastName = "Souza",
                        EmailConfirmed = true,
                        UserName = "******",
                        PhoneNumber = "(19) 99856-0989",
                        UserType = UserType.GlobalAdmin
                    };

                    userManager.Create(user, "Ricardo12__");
                }

                string cpf = "000.000.000-00";
                Address address = new PostalCodeService().GetAdrressFromPostalCode("13024-420").Address;

                address.State = Common.StateTranslator.GetStateName(address.State);

                GlobalManager globalManager = new GlobalManager
                {
                    Address = address,
                    FirstName = user.FirstName,
                    LastName = user.LastName,
                    CPF = cpf,
                    Email = user.Email,
                    Password = user.PasswordHash,
                    Telephone = user.PhoneNumber,
                    TokenHash = HashServices.HashPassword("547458", cpf),
                    StreetNumber = 123
                };

                BusinessManager.Instance.GlobalManagers.Add(globalManager);
            }

            if (!Request.IsAuthenticated)
            {
                return RedirectToAction("Login", "Account");
            }

            return View();
        }
Esempio n. 3
0
        public InvokeResult <CheckOpenIdCanResponseRet> CheckOpenIdCanResponse(string openId, string workOrderId, string buttonTag)
        {
            InvokeResult <CheckOpenIdCanResponseRet> result = new InvokeResult <CheckOpenIdCanResponseRet> {
                Success = true, ret = new CheckOpenIdCanResponseRet()
            };

            try
            {
                //判读传入的OpenId是否合法
                var workOrder = BuilderFactory.DefaultBulder().Load <ServiceWorkOrder, ServiceWorkOrderPK>(new ServiceWorkOrderPK {
                    WorkOrderId = workOrderId.ToGuid()
                });
                if (workOrder.WorkOrderId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 51002;
                }
                else
                {
                    //判断服务人员和传入的OpenId
                    if (!GlobalManager.IsAuthorizedForOpenIdToStation(openId, workOrder.ServeStationId))
                    {
                        result.Success   = false;
                        result.ErrorCode = 51003;
                    }
                    else
                    {
                        /*
                         * if (GlobalManager.GetServeManIdByOpenId(openId, workOrder.ServeStationId) != workOrder.ServeManId)
                         * {
                         *  //检查OpenId对应的是否当前相应工单规定的服务人员
                         *  result.Success = false;
                         *  result.ErrorCode = 51004;
                         * }
                         * else
                         * {
                         *
                         * }
                         */
                        if (buttonTag == GlobalManager.enumButtonTag.Arrive.ToString())
                        {
                            if (workOrder.ServeManArriveTime != null)
                            {
                                //工单已被响应到达
                                result.Success   = false;
                                result.ErrorCode = 51005;
                            }
                        }
                        else if (buttonTag == GlobalManager.enumButtonTag.Leave.ToString())
                        {
                            if (workOrder.ServeManArriveTime == null)
                            {
                                //工单未被响应到达无法响应离开
                                result.Success   = false;
                                result.ErrorCode = 51006;
                            }
                            if (workOrder.ServeManLeaveTime != null)
                            {
                                //工单已被响应离开
                                result.Success   = false;
                                result.ErrorCode = 51007;
                            }
                        }
                        else if (buttonTag == GlobalManager.enumButtonTag.Feedback.ToString())
                        {
                            if (workOrder.ServeManArriveTime == null)
                            {
                                //工单未被响应到达无法响应评价
                                result.Success   = false;
                                result.ErrorCode = 51008;
                            }
                            if (workOrder.ServeManLeaveTime == null)
                            {
                                //工单未被响应离开无法响应评价
                                result.Success   = false;
                                result.ErrorCode = 51009;
                            }
                        }
                    }

                    result.ret.ServeManName = workOrder.ServeManName;
                    result.ret.OldManName   = workOrder.OldManName;
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Esempio n. 4
0
 public void SetItem(int num)
 {
     GlobalManager.SetItem(num);
 }
Esempio n. 5
0
 public void SetLoadScene(int num)
 {
     GlobalManager.SetLoadScene(num);
 }
 // Start is called before the first frame update
 void Start()
 {
     level5Button = GetComponent <Button>();
     globalMng    = FindObjectOfType <GlobalManager>();
     level5Button.onClick.AddListener(globalMng.Level5);
 }
 // Use this for initialization
 void Start()
 {
     globalManagerSCR = GameObject.FindGameObjectWithTag("GlobalManager").GetComponent<GlobalManager>();
     StartCoroutine(NumberOfHeroesDisplay());
 }
Esempio n. 8
0
 void Awake( )
 {
     if ( _instance == null ) {
         //If I am the first instance, make me the Singleton
         _instance = this;
         DontDestroyOnLoad ( this );
     } else {
         //If a Singleton already exists and you find
         //another reference in scene, destroy it!
         if ( this != _instance )
             Destroy ( this.gameObject );
     }
     if ( rage == null && GameObject.Find ( "RagePanel" ) ) {
         rage = GameObject.Find ( "RagePanel" ).GetComponent<RagePanelController> ( );
         progressBar = GameObject.Find ( "ProgressBarLabelRight" ).GetComponent<ProgressBarBehaviour> ( );
         player = GameObject.Find ( "Player" ).GetComponent<PlayerControl> ( );
     }
 }
Esempio n. 9
0
        private void HookupEvents()
        {
            var tm = GlobalManager.GetManager <TileManager>();

            tm.OnMouseTileHover += TileManagerOnMouseTileHover;
        }
Esempio n. 10
0
 public virtual void OnDestroy()
 {
     this.pgm = null;
 }
Esempio n. 11
0
 private void OnPlayerPreSaveArchive(object sender, PlayerPreSaveArchiveEvent e)
 {
     GlobalManager.GetControllerManager().PlayerArchiveController.CurrentArchiveData.EvidenceArchiveData.EvidenceList = MyEvidenceDic;
 }
Esempio n. 12
0
 private void OnPlayerPreSaveArchive(object sender, PlayerPreSaveArchiveEvent e)
 {
     GlobalManager.GetControllerManager().PlayerArchiveController.CurrentArchiveData.StoryArchiveData.LogInfos = m_logInfos;
 }
 void OnAllCannonsDestroyed()
 {
     GlobalManager.DisableAllUpdates();
 }
Esempio n. 14
0
 void Start()
 {
     managerG = GameObject.Find("GlobalManager").GetComponent <GlobalManager>();
 }
 void Start()
 {
     teamManagerSCR = GameObject.FindGameObjectWithTag("TeamManager").GetComponent<TeamManager>();						// pour la gestion de team
     globalManagerSCR = GameObject.FindGameObjectWithTag("GlobalManager").GetComponent<GlobalManager>(); 				// pour la limite du nombre de hero
     moneyManager = GameObject.FindGameObjectWithTag ("MoneyManager").GetComponent<MoneyManager> ();						// pour le prix du hero (outcome)
     ModalWindowManagerSCR = GameObject.FindGameObjectWithTag("ModalWindowManager").GetComponent<ModalWindowManager>();	// pour la demande de suppression de hero
     inventorySCR = GameObject.FindGameObjectWithTag("Inventory").GetComponent<Inventory>();								// pour la suppression de hero
     if(heroStatsSCR.heroStatus == 0	)																					// Si le hero est en attente d'achat
     {
         StartCoroutine(DisplayHeroCoroutine());																			// fais afficher le hero dans le panel mercenary																			// ajoute le hero au nombre de heros actifs
     }
     else if(heroStatsSCR.heroStatus == 1)																				// Si le hero est actif et en vie
     {
         globalManagerSCR.numberOfHeroes ++;																				// ajoute le hero au nombre de heros actifs
         HeroDisplayManagerSCR.DisplayInPanelRight();																	// Affiche le hero dans le panel right
         HeroDisplayManagerSCR.DisplayInPanelPantheon();																	// Affiche le hero dans le panel Pantheon
         HeroDisplayManagerSCR.DisplayInItemHeroSelection();																// Affiche le hero dans le panel d'inventaire
         if(heroStatsSCR.heroHp < heroStatsSCR.heroMaxHp)					// Si les hp ne sont pax maxés
         {
             HeroDisplayManagerSCR.DisplayInNursery ();						// Cree un panel dans l'infirmerie
         }
     }
     else if(heroStatsSCR.heroStatus == 2)
     {
         HeroDisplayManagerSCR.DisplayInPanelPantheon();																	// Affiche le hero dans le panel Pantheon
         HeroDisplayManagerSCR.DisplayInGraveyard();																		// Affiche le hero dans le cimetiere
     }
 }
Esempio n. 16
0
 void Start()
 {
     managerG = GameObject.Find("GlobalManager").GetComponent <GlobalManager>();
 }
Esempio n. 17
0
 void LoadNextLevel()
 {
     GlobalManager.LoadLevel(GlobalManager.curLevelNum + 1);
 }
Esempio n. 18
0
    void Start( )
    {
        globalManager = GameObject.FindObjectOfType<GlobalManager> ( );

        isInMainMenu = ( Application.loadedLevelName == StringsDatabase.menuSceneName ? true : false );
        isGameOver = false;

        if ( RagePanel != null ) {
            RagePanel.SetActive ( true );
        }

        if ( isInMainMenu ) {
            MainMenu ( );
            isShowingMenu = true;
        } else {
            PauseMenu ( );
            isShowingMenu = false;
        }

        BuildMenuButtons ( );
        BuildCreditsPanel ( );

        isShowingCreditsPanel = false;
        CreditsControlPanel.SetActive ( false );

        if (GameJolt.API.Manager.Instance.CurrentUser == null) {
            signInPart.SetActive(true);
        }
        else {
            signInPart.SetActive(false);
        }
    }
Esempio n. 19
0
 void ReloadLevelSingle()
 {
     Network.isMessageQueueRunning = false;
     GlobalManager.LoadLevel(GlobalManager.curLevelNum);
 }
 public Area_V GetCommunityInfo(string areaId)
 {
     return(BuilderFactory.DefaultBulder(GlobalManager.getConnectString()).Load <Area_V, Area_VPK>(new Area_VPK {
         AreaId = areaId
     }));
 }
Esempio n. 21
0
 private void OnPlayerPreSaveArchive(object sender, PlayerPreSaveArchiveEvent e)
 {
     GlobalManager.GetControllerManager().PlayerArchiveController.CurrentArchiveData.StoryArchiveData.ReadLabels = m_readLabel;
 }
 public GlobalManager()
 {
     s_Instance = this;
 }
Esempio n. 23
0
        static void Main(string[] args)
        {
            Console.WriteLine("Bienvenu dans Mathias");
            RUNNING = true;
            active  = true;
            GlobalManager.InitMathias();

            Console.WriteLine("Initialisation de la Kinect");
            speaker = new SpeechSynthesizer();

            List <InstalledVoice> voices = speaker.GetInstalledVoices().ToList();

            Console.WriteLine(speaker.Voice.Name);

            speaker.Speak("Démarrage en cours");
            kinectSensor = KinectSensor.GetDefault();
            if (kinectSensor != null)
            {
                Console.WriteLine("La kinect est récupérée");
                kinectSensor.Open();
                Console.WriteLine("La kinect est prête à recevoir les informations");

                Console.WriteLine("Récupération de l'audio beam");
                IReadOnlyList <AudioBeam> audioBeamList = kinectSensor.AudioSource.AudioBeams;
                Stream audioStream = audioBeamList[0].OpenInputStream();
                Console.WriteLine("Stream et audio beam OK");

                Console.WriteLine("Conversion de l'audioStream");
                convertStream = new KinectAudioStream(audioStream);
                Console.WriteLine("Conversion OK");
            }
            else
            {
                Console.WriteLine("Impossible de récupérer la kinect");
            }


            Console.WriteLine(GlobalManager.RI.Name + "Récupéré");

            if (GlobalManager.RI != null)
            {
                Console.WriteLine("Construction du grammar sample");
                speechEngine = new SpeechRecognitionEngine(GlobalManager.RI.Id);
                Console.WriteLine("Construction du grammar terminée");
                speechEngine.LoadGrammar((Grammar)GlobalManager.CONTEXT.GRAMMAR);
                speechEngine.SpeechRecognized          += SpeechRecognized;
                speechEngine.SpeechRecognitionRejected += SpeechRejected;

                convertStream.SpeechActive = true;

                speechEngine.SetInputToAudioStream(convertStream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null));
                speechEngine.RecognizeAsync(RecognizeMode.Multiple);
                Console.WriteLine("Il ne reste plus qu'a parler");
            }
            else
            {
                Console.WriteLine("Could not find speech recognizer");
            }

            while (GlobalManager.RUNNING)
            {
            }

            if (!GlobalManager.RUNNING)
            {
                speaker.Speak("Au revoir");
            }
        }