Example #1
0
        //
        public DefaultDTO carregar()
        {
            var ORetorno = new DefaultDTO();

            this.idOrganizacao = CustomExtensions.getIdOrganizacao();

            this.id = UtilRequest.getInt32("id");

            if (this.id == 0)
            {
                ORetorno.flagErro = true;

                ORetorno.listaMensagens.Add("O associado/não associado não foi identificado.");

                return(ORetorno);
            }

            var query = this.montarQuery();

            var listagem = this.filtrarListagem(query);

            ORetorno = this.montarRetorno(listagem);

            return(ORetorno);
        }
        public async Task <IActionResult> OnGetAsync(string sortOrder)
        {
            LoggedInUser = await _userManager.GetUserAsync(HttpContext.User);

            InitialisePage(LoggedInUser);
            MSD3VM = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD3Key] != null ? new MSD3ViewModel(TempData.GetKeep <MSD3ViewModel>(MSD3Key)) : new MSD3ViewModel();

            string submitted = CustomExtensions.NotNullOrEmpty(TempData) && TempData[SubmittedKey] != null?TempData.GetKeep <string>(SubmittedKey) : "";

            var existingParent = FindSubmission();

            if (existingParent != null)
            {
                TempData.Put("SubmittedKey", "true");
                TempData.Remove(MSD3Key);
                AssignMSD3ToInput(existingParent);
            }
            else
            {
                string slectedYearQuarter = MSD23.Year.ToString() + MSD23.Quarter.ToString();
                if (submitted.ToString() == "true")
                {
                    MSD3VM.AgentSummary.Clear();
                    TempData.Remove(MSD3Key);
                }
                else if (submitted.ToString() != "false" + slectedYearQuarter)
                {
                    MSD3VM.AgentSummary.Clear();
                    TempData.Remove(MSD3Key);
                }
                TempData.Put("SubmittedKey", "false" + slectedYearQuarter);
            }

            return(Page());
        }
        public DefaultDTO carregar()
        {
            int idHotsite = UtilRequest.getInt32("idHotsite");

            int idOrganizacao = CustomExtensions.getIdOrganizacao();

            var idEventoGaleriaFoto = OHotsiteConsultaBL.query(idOrganizacao).Where(x => x.id == idHotsite).Select(x => x.idEventoGaleriaFoto)
                                      .FirstOrDefault();

            var idGaleriaFoto = OEventoConsultaBL.query(idOrganizacao).Where(x => x.id == idEventoGaleriaFoto).Select(x => x.idGaleriaFoto)
                                .FirstOrDefault();

            var OGaleriaFoto = this.OGaleriaFotoBL.query(idOrganizacao).FirstOrDefault(x => x.id == idGaleriaFoto && x.ativo == "S");

            if (OGaleriaFoto == null)
            {
                var ORetorno = new DefaultDTO {
                    flagErro       = true,
                    listaMensagens = new List <string> {
                        "Nenhuma galeria encontrada."
                    }
                };

                return(ORetorno);
            }

            var ORetornoMontado = this.montarRetorno(OGaleriaFoto);

            return(ORetornoMontado);
        }
        /// <summary>
        /// Adds the label.
        /// </summary>
        /// <param name="labelPath">The label path.</param>
        /// <param name="rect">The rect.</param>
        /// <param name="degrees">The degrees.</param>
        /// <param name="value">The value.</param>
        private void AddLabel(GraphicsPath labelPath, RectangleF rect, double degrees, int value)
        {
            double offset = 0;

            switch (LabelPosition)
            {
            case LabelPosition.Inside:
                offset = -LabelOffset;
                break;

            case LabelPosition.Outside:
                offset = LabelOffset;
                break;
            }

            PointF center = GraphicsHelper.GetPointInArc(rect, degrees, offset);

            using (Bitmap bm = new Bitmap(1, 1))
                using (Graphics g = Graphics.FromImage(bm))
                    using (Font font = new Font(LabelFontFamily, LabelFontSize, LabelFontStyle))
                    {
                        SizeF size = SizeF.Empty;
                        try
                        {
                            size = CustomExtensions.MeasureDisplayStringSize(g, value.ToString(), font);
                        }
                        catch { }

                        PointF origin = new PointF(center.X - (size.Width / 2f),
                                                   center.Y - (size.Height / 2f));
                        labelPath.AddString(value.ToString(), font.FontFamily, (int)font.Style, font.Size,
                                            origin, StringFormat.GenericDefault);
                    }
        }
        //
        public DefaultDTO buscar()
        {
            var ORetorno = new DefaultDTO();

            this.idOrganizacao = CustomExtensions.getIdOrganizacao();

            this.nroDocumento  = UtilRequest.getString("nroDocumento");
            this.nroPassaporte = UtilRequest.getString("nroPassaporte");
            this.limite        = UtilRequest.getInt32("limite");

            if (this.nroDocumento.isEmpty() && this.nroPassaporte.isEmpty())
            {
                ORetorno.flagErro = true;

                ORetorno.listaMensagens.Add("Informe o documento para localização da inscrição.");

                return(ORetorno);
            }

            var listagem = this.carregarDados();

            ORetorno = this.montarRetorno(listagem);

            return(ORetorno);
        }
        private void InitialisePage()
        {
            Vessels = _context.WorldFleet.AsNoTracking().Select
                      (
                x =>
                x.Imo.ToString() +
                " - " + x.ShipName.ToString() +
                " (" + x.FlagCode.ToString() + ")"
                      )
                      .ToList();

            if (CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD1Key] != null)
            {
                MSD1 = new MSD1(TempData.GetKeep <MSD1>(MSD1Key));

                if (MSD1.Imo != 0)
                {
                    Vessel = MSD1.Imo.ToString() +
                             " - " + MSD1.ShipName.ToString() +
                             " (" + MSD1.FlagCode + ")";
                }
            }

            FromSummary = Helpers.ReturnBoolFromQueryString(HttpContext, "FromSummary");
        }
Example #7
0
        public void Awake()
        {
            if (Instance != this)
            {
                Instance = this;
                DontDestroyOnLoad(gameObject);

                Client.Instance.MessageReceived -= PacketReceived;
                Client.Instance.MessageReceived += PacketReceived;
                _currentScene = SceneManager.GetActiveScene().name;

                _messageDisplayText = CustomExtensions.CreateWorldText(transform, "");
                transform.position  = new Vector3(40f, -43.75f, 3.75f);
                transform.rotation  = Quaternion.Euler(-30f, 0f, 0f);
                _messageDisplayText.overflowMode       = TextOverflowModes.Overflow;
                _messageDisplayText.enableWordWrapping = false;
                _messageDisplayText.alignment          = TextAlignmentOptions.Center;
                DontDestroyOnLoad(_messageDisplayText.gameObject);
                CustomAvatar.Plugin.Instance.PlayerAvatarManager.AvatarChanged += PlayerAvatarManager_AvatarChanged;

                if (Config.Instance.EnableVoiceChat)
                {
                    voiceChatListener = new GameObject("Voice Chat Listener").AddComponent <VoipListener>();

                    voiceChatListener.OnAudioGenerated += ProcesVoiceFragment;

                    DontDestroyOnLoad(voiceChatListener.gameObject);

                    isVoiceChatActive = true;
                }
            }
        }
Example #8
0
        public async void SetSong(IBeatmapLevel level, BeatmapCharacteristicSO characteristic, BeatmapDifficulty difficulty)
        {
            selectedLevel = level;
            selectedBeatmapCharacteristic = characteristic;
            selectedDifficulty            = difficulty;

            songNameText.text = selectedLevel.songName;

            _playerDataModel.playerData.SetLastSelectedBeatmapCharacteristic(selectedBeatmapCharacteristic);

            var diffBeatmaps = selectedLevel.beatmapLevelData.GetDifficultyBeatmapSet(selectedBeatmapCharacteristic).difficultyBeatmaps;

            int diffIndex = CustomExtensions.GetClosestDifficultyIndex(diffBeatmaps, selectedDifficulty);

            difficultyControlRect.gameObject.SetActive(perPlayerDifficulty);
            difficultyControl.SetTexts(diffBeatmaps.Select(x => x.difficulty.ToString().Replace("Plus", "+")).ToArray());
            difficultyControl.SelectCellWithNumber(diffIndex);

            playNowButton.SetButtonText("PLAY NOW");
            playNowButtonGlow.SetGlow("#5DADE2");

            SetProgressBarState(false, 0f);

            levelCoverImage.texture = await selectedLevel.GetCoverImageTexture2DAsync(new CancellationTokenSource().Token);
        }
        public HttpResponseMessage Get(HttpRequestMessage request)
        {
            var RetornoApi = new DefaultDTO();

            var FormularioConsulta = new InscricaoEtapaConsultaForm {
                idOrganizacao        = CustomExtensions.getIdOrganizacao(),
                idProcessoAvaliacao  = UtilRequest.getInt32("idProcessoAvaliacao"),
                idEtapa              = UtilRequest.getInt32("idEtapa"),
                idsAreasConhecimento = UtilRequest.getListInt("idsAreasConhecimento"),
                flagAprovados        = UtilRequest.getBool("flagAprovados"),
                nroRegistros         = UtilRequest.getNroRegistros(),
                nroPagina            = UtilRequest.getNroPagina()
            };

            try {
                if (FormularioConsulta.idProcessoAvaliacao <= 0)
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("O processo de avaliação deve ser informado.");
                    RetornoApi.listaResultados = null;

                    return(Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                if (FormularioConsulta.idEtapa <= 0)
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("A Etapa deve ser informada.");
                    RetornoApi.listaResultados = null;

                    return(Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                var RetornoConsulta = Filler.carregar(FormularioConsulta);

                if (!RetornoConsulta.listaAprovados.Any())
                {
                    RetornoApi.flagErro = false;
                    RetornoApi.listaMensagens.Add("Nenhuma inscrição na etapa foi encontrada.");
                    RetornoApi.listaResultados = null;

                    return(Request.CreateResponse(HttpStatusCode.OK, RetornoApi));
                }

                RetornoApi.flagErro = false;
                RetornoApi.listaMensagens.Add("Inscrições na etapa listadas com sucesso.");
                RetornoApi.listaResultados = RetornoConsulta.listaAprovados;
                RetornoApi.carregarDadosPaginacao(RetornoConsulta.listaAprovados);

                return(Request.CreateResponse(HttpStatusCode.OK, RetornoApi));
            } catch (Exception ex) {
                var message = ex.getLogError("Erro no serviço de listagem de inscrição em etapas de processos de avaliação");

                RetornoApi.flagErro = true;
                RetornoApi.listaMensagens.Add(message);

                return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, RetornoApi));
            }
        }
 public void UpdateTexts(LevelData levelData, long yourTime)
 {
     LevelTitle.text       = "Level " + levelData.name.ToString().Split('_')[1];
     Coins.text            = string.Format("{0:00} / {1:00}", levelData.CoinsCollected, levelData.TotalCoins);
     YourTime.text         = CustomExtensions.MillisecondsToTimer(yourTime);
     BestTime.text         = CustomExtensions.MillisecondsToTimer(levelData.FastestTime);
     BestTimeAllCoins.text = CustomExtensions.MillisecondsToTimer(levelData.FastestTimeAllCoins);
 }
 private void InitialisePage(PortFreightUser user)
 {
     MSD23 = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD23Key] != null ? new MSD23(TempData.GetKeep <MSD23>(MSD23Key)) : new MSD23();
     var locodes = (from p in _context.SenderIdPort
                    join t in _context.SenderType on p.SenderId equals t.SenderId
                    where (t.IsPort == true) && p.SenderId == user.SenderId
                    select p.Locode).ToList();
 }
        public async Task <HttpResponseMessage> Post(HttpRequestMessage request)
        {
            var jsonString = await request.Content.ReadAsStringAsync();

            var RetornoApi = new DefaultDTO();

            try {
                if (!jsonString.isValidJson())   // Validação de estrutura incorreta do json

                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("Não foi possível receber os dados enviados, verifique o formato.");

                    return(this.Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                var Form = JsonConvert.DeserializeObject <EventoAgendaAvaliacaoForm>(jsonString, new IsoDateTimeConverter());
                EventoAgendaAvaliacao NewEventoAgendaAvaliacao = new EventoAgendaAvaliacao {
                    idDevice       = Form.idDevice,
                    idEvento       = Form.idEvento,
                    idEventoAgenda = Form.idEventoAgenda,
                    idInscricao    = Form.idInscricao,
                    nota           = Form.nota.toByte(),
                    idOrganizacao  = CustomExtensions.getIdOrganizacao()
                };

                var RetornoValidacao = ValidatorEventoAgendaAvaliacao.Validate(NewEventoAgendaAvaliacao);
                if (RetornoValidacao.retornarErros().Any())   // Validação dos campos
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.AddRange(RetornoValidacao.retornarErros());

                    return(this.Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                var RetornoCadastro = CadastroEventoAgendaAvaliacao.salvar(NewEventoAgendaAvaliacao);
                if (RetornoCadastro.flagError)   // Validação de cadastro
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("Não foi possível registrar a avaliação da atração, tente novamente!");
                    RetornoApi.listaMensagens.AddRange(RetornoCadastro.listaErros);

                    return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, RetornoApi));
                }

                RetornoApi.flagErro = false;
                RetornoApi.listaMensagens.Add("Avaliação realizada com sucesso!");

                return(this.Request.CreateResponse(HttpStatusCode.OK, RetornoApi));
            } catch (Exception ex) {
                var message = ex.getLogError($"Erro no serviço de cadastro de avaliação de programações.");

                RetornoApi.flagErro = true;
                RetornoApi.listaMensagens.Add(message);

                return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, RetornoApi));
            }
        }
 private void InitialisePage(PortFreightUser user)
 {
     MSD23   = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD23Key] != null ? new MSD23(TempData.GetKeep <MSD23>(MSD23Key)) : new MSD23();
     Senders = _context.OrgList
               .Where(s => s.IsAgent || s.IsLine)
               .Select(s =>
                       s.OrgId.ToString() + " - " + s.OrgName.ToString()
                       ).ToList();
 }
    public void CreateBranchSegment(Vector3 n_startPosTemp, float n_angleTemp, Vector2 n_scaleTemp, int n_depthTemp, GameObject n_thisOBJ)
    {
        int Tempint;

        Tempint = Random.Range(1, 4);

        Quaternion rot = Quaternion.Euler(0, 0, n_angleTemp);

        Vector3 topPos = n_startPosTemp + (rot * (TreeParms.trunkTopOffset * (n_scaleTemp.y)));

        //THE 4 TREE RULES OF ISENGARD
        float angleLeft  = CustomExtensions.ClampAngle(n_angleTemp - TreeParms.branchAngle + Random.Range(-TreeParms.angleRandom, TreeParms.angleRandom));
        float angleRight = CustomExtensions.ClampAngle(n_angleTemp + TreeParms.branchAngle + Random.Range(-TreeParms.angleRandom, TreeParms.angleRandom));

        switch (Tempint)
        {
        case 1:
            //Create Left Side
            TreeParms.CreateSegment(topPos, n_startPosTemp,
                                    angleLeft,
                                    new Vector2(n_scaleTemp.x,
                                                n_scaleTemp.y - (TreeParms.scaleChange + Random.Range(0, TreeParms.scaleRandom))),
                                    n_depthTemp + 1, "Main_Left_Branch", n_thisOBJ, Tree_Master.treeMasterGameOBJ, Tree_Master.trunkPrefab,
                                    Tree_Segment_Script.TreeSegmentType.BRANCH);
            break;

        case 2:
            //Create Right Side
            TreeParms.CreateSegment(topPos, n_startPosTemp,
                                    angleRight,
                                    new Vector2(n_scaleTemp.x,
                                                n_scaleTemp.y - (TreeParms.scaleChange + Random.Range(0, TreeParms.scaleRandom))),
                                    n_depthTemp + 1, "Main_Right_Branch", n_thisOBJ, Tree_Master.treeMasterGameOBJ, Tree_Master.trunkPrefab,
                                    Tree_Segment_Script.TreeSegmentType.BRANCH);
            break;

        case 3:
            //Create Left Side
            TreeParms.CreateSegment(topPos, n_startPosTemp,
                                    angleLeft,
                                    new Vector2(n_scaleTemp.x,
                                                n_scaleTemp.y - (TreeParms.scaleChange + Random.Range(0, TreeParms.scaleRandom))),
                                    n_depthTemp + 1, "Twin_Left_Branch", n_thisOBJ, Tree_Master.treeMasterGameOBJ, Tree_Master.trunkPrefab,
                                    Tree_Segment_Script.TreeSegmentType.BRANCH);

            //Create Right Side
            TreeParms.CreateSegment(topPos, n_startPosTemp,
                                    angleRight,
                                    new Vector2(n_scaleTemp.x,
                                                n_scaleTemp.y - (TreeParms.scaleChange + Random.Range(0, TreeParms.scaleRandom))),
                                    n_depthTemp + 1, "Twin_Right_Branch", n_thisOBJ, Tree_Master.treeMasterGameOBJ, Tree_Master.trunkPrefab,
                                    Tree_Segment_Script.TreeSegmentType.BRANCH);
            break;
        }
    }
Example #15
0
        public void SetSelectedCharateristic(IconSegmentedControl sender, int index)
        {
            _playerDataModel.playerData.SetLastSelectedBeatmapCharacteristic(_beatmapCharacteristics[index]);

            var diffBeatmaps = _selectedLevel.beatmapLevelData.GetDifficultyBeatmapSet(_beatmapCharacteristics[index]).difficultyBeatmaps;

            int diffIndex = CustomExtensions.GetClosestDifficultyIndex(diffBeatmaps, _playerDataModel.playerData.lastSelectedBeatmapDifficulty);

            difficultyControl.SetTexts(diffBeatmaps.Select(x => x.difficulty.ToString().Replace("Plus", "+")).ToArray());
            difficultyControl.SelectCellWithNumber(diffIndex);
            SetSelectedDifficulty(null, diffIndex);
        }
        public async Task <IActionResult> OnPostCargoReturn(string id)
        {
            string portname = await _context.GlobalPort.AsNoTracking().Where(x => x.Locode == Input.ReportingPort).Select(x => x.PortName).FirstOrDefaultAsync();

            MSD23          = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD23Key] != null ? new MSD23(TempData.GetKeep <MSD23>(MSD23Key)) : new MSD23();
            MSD23.Port     = Input.ReportingPort;
            MSD23.Year     = ushort.Parse(id.Substring(1, 4));
            MSD23.Quarter  = ushort.Parse(id.Substring(0, 1));
            MSD23.PortName = portname;
            TempData.Put(MSD23Key, MSD23);

            return(RedirectToPage("./CargoReturn"));
        }
        private void _characteristicControl_didSelectCellEvent(int arg2)
        {
            try
            {
                selectedCharacteristic = _selectedSong.beatmapCharacteristics[arg2];

                Dictionary <IDifficultyBeatmap, string> difficulties = _selectedSong.difficultyBeatmapSets.First(x => x.beatmapCharacteristic == selectedCharacteristic).difficultyBeatmaps.ToDictionary(x => x, x => x.difficulty.ToString().Replace("Plus", "+"));

                if (_selectedSong is CustomLevel)
                {
                    CustomLevel customSelectedSong = _selectedSong as CustomLevel;
                    var         songData           = SongCore.Collections.RetrieveExtraSongData(customSelectedSong.levelID);
                    if (songData != null && songData.difficulties != null)
                    {
                        for (int i = 0; i < difficulties.Keys.Count; i++)
                        {
                            var diffKey = difficulties.Keys.ElementAt(i);

                            var difficultyLevel = songData.difficulties.FirstOrDefault(x => x.difficulty == diffKey.difficulty);
                            if (difficultyLevel != null && !string.IsNullOrEmpty(difficultyLevel.difficultyLabel))
                            {
                                difficulties[diffKey] = difficultyLevel.difficultyLabel;
                                Plugin.log.Info($"Found difficulty label \"{difficulties[diffKey]}\" for difficulty {diffKey.difficulty.ToString()}");
                            }
                        }
                    }
                    else
                    {
                        Plugin.log.Warn($"Unable to retrieve extra song data for song with LevelID \"{customSelectedSong.levelID}\"!");
                    }
                }

                _difficultyControl.SetTexts(difficulties.Values.ToArray());

                int closestDifficultyIndex = CustomExtensions.GetClosestDifficultyIndex(difficulties.Keys.ToArray(), selectedDifficulty);

                _difficultyControl.SelectCellWithNumber(closestDifficultyIndex);

                if (!difficulties.Any(x => x.Key.difficulty == selectedDifficulty))
                {
                    _difficultyControl_didSelectCellEvent(closestDifficultyIndex);
                }
                else
                {
                    levelOptionsChanged?.Invoke();
                }
            }catch (Exception e)
            {
                Plugin.log.Critical($"Exception in char control did select event: {e}");
            }
        }
Example #18
0
        public async Task <IActionResult> OnGetAsync()
        {
            InitialisePage();

            loggedInUser = await _userManager.GetUserAsync(HttpContext.User);

            if (loggedInUser == null || loggedInUser.SenderId == null)
            {
                return(RedirectToPage("/Account/Logout", new { area = "Identity" }));
            }

            var senderTypesDetails = _helperService.GetSenderType(loggedInUser.SenderId);
            var AgentId            = !CustomExtensions.NotNullOrEmpty(Input.AgentSenderId) && senderTypesDetails.IsAgent == true
                ? loggedInUser.SenderId : Input.AgentSenderId;
            var LineId = !CustomExtensions.NotNullOrEmpty(Input.LineSenderId) && senderTypesDetails.IsLine == true
                ? loggedInUser.SenderId : Input.LineSenderId;

            if (LineId != null)
            {
                Input.LineSenderId = _context.ContactDetails.Where(s => s.SenderId == LineId).Select
                                     (
                    s =>
                    s.SenderId.ToString() +
                    " - " + s.CompanyName.ToString()).SingleOrDefault();
            }
            if (AgentId != null)
            {
                Input.AgentSenderId = _context.ContactDetails.Where(s => s.SenderId == AgentId).Select
                                      (
                    s =>
                    s.SenderId.ToString() +
                    " - " + s.CompanyName.ToString()).SingleOrDefault();
            }

            if (CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD1Key] != null)
            {
                MSD1 = new MSD1(TempData.GetKeep <MSD1>(MSD1Key));
                if (CustomExtensions.NotNullOrEmpty(MSD1.AgentSenderID) || CustomExtensions.NotNullOrEmpty(MSD1.LineSenderID))
                {
                    Input.AgentSenderId = MSD1.AgentSenderID +
                                          " - " + MSD1.AgentCompanyName;

                    Input.LineSenderId = MSD1.LineSenderID +
                                         " - " + MSD1.LineCompanyName;
                }
            }

            FromSummary = Helpers.ReturnBoolFromQueryString(HttpContext, "FromSummary");

            return(Page());
        }
        IEnumerator InitializeAvatarController()
        {
            if (!defaultAvatarInstance.IsLoaded)
            {
#if DEBUG
                Plugin.log.Info("Waiting for avatar to load");
#endif
                yield return(new WaitWhile(delegate() { return !defaultAvatarInstance.IsLoaded; }));
            }
            else
            {
                yield return(null);
            }

#if DEBUG
            Plugin.log.Info("Spawning avatar");
#endif
            centerAdjust = FindObjectOfType <VRCenterAdjust>();

            avatar          = AvatarSpawner.SpawnAvatar(defaultAvatarInstance, this);
            exclusionScript = avatar.GameObject.GetComponentsInChildren <AvatarScriptPack.FirstPersonExclusion>().FirstOrDefault();
            if (exclusionScript != null)
            {
                exclusionScript.SetVisible();
            }

            playerNameText = CustomExtensions.CreateWorldText(transform, "INVALID");
            playerNameText.rectTransform.anchoredPosition3D = new Vector3(0f, 0.25f, 0f);
            playerNameText.alignment = TextAlignmentOptions.Center;
            playerNameText.fontSize  = 2.5f;

            playerSpeakerIcon = new GameObject("Player Speaker Icon", typeof(Canvas), typeof(CanvasRenderer)).AddComponent <Image>();
            playerSpeakerIcon.GetComponent <Canvas>().renderMode = RenderMode.WorldSpace;
            playerSpeakerIcon.rectTransform.SetParent(transform);
            playerSpeakerIcon.rectTransform.localScale         = new Vector3(0.004f, 0.004f, 1f);
            playerSpeakerIcon.rectTransform.pivot              = new Vector2(0.5f, 0.5f);
            playerSpeakerIcon.rectTransform.anchoredPosition3D = new Vector3(0f, 0.65f, 0f);
            playerSpeakerIcon.sprite = Sprites.speakerIcon;

            avatar.GameObject.transform.SetParent(centerAdjust.transform, false);
            transform.SetParent(centerAdjust.transform, false);

            if (ModelSaberAPI.cachedAvatars.Any(x => x.Value == avatar.CustomAvatar))
            {
                currentAvatarHash = ModelSaberAPI.cachedAvatars.First(x => x.Value == avatar.CustomAvatar).Key;
            }
            else
            {
                currentAvatarHash = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
            }
        }
Example #20
0
        public async Task <HttpResponseMessage> Get(int idEvento, string idPaisOrigem = "", string valorBusca = "", bool flagAtracoes = false)
        {
            var ViewModel = new EventoPalestranteListagemVM {
                idEvento      = idEvento,
                idPaisOrigem  = idPaisOrigem,
                valorBusca    = valorBusca,
                flagAtracoes  = flagAtracoes,
                idOrganizacao = CustomExtensions.getIdOrganizacao()
            };

            var ORetorno = ViewModel.carregar();

            return(Request.CreateResponse(HttpStatusCode.OK, ORetorno));
        }
Example #21
0
    private void LateUpdate()
    {
        if (_playerBody == null || _camera == null)
        {
            return;
        }

        _playerBody = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>();

        float zoom     = CustomExtensions.Remap(_playerBody.velocity.magnitude, 0, 40, MinZoom, MaxZoom);
        float zoomDamp = Mathf.Lerp(_camera.m_Lens.OrthographicSize, zoom, (1 - ZoomSmooth) / 100);

        _camera.m_Lens.OrthographicSize = zoomDamp;
    }
Example #22
0
        void Awake()
        {
            playerPlaceText = CustomExtensions.CreateWorldText(transform, "");
            playerPlaceText.rectTransform.anchoredPosition = new Vector2(2.5f, 0f);
            playerPlaceText.fontSize = 8f;

            playerNameText = CustomExtensions.CreateWorldText(transform, "");
            playerNameText.rectTransform.anchoredPosition = new Vector2(4f, 0f);
            playerNameText.fontSize = 7f;

            playerScoreText = CustomExtensions.CreateWorldText(transform, "");
            playerScoreText.rectTransform.anchoredPosition = new Vector2(15f, 0f);
            playerScoreText.fontSize = 8f;
        }
        public async Task OnPostRemoveAgent(Guid?Id)
        {
            ModelState.Clear();
            LoggedInUser = await _userManager.GetUserAsync(HttpContext.User);

            if (Id != null && Id != Guid.Empty)
            {
                var localMSD3 = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD3Key] != null ? new MSD3ViewModel(TempData.GetKeep <MSD3ViewModel>(MSD3Key)) : new MSD3ViewModel();;
                var agentItem = localMSD3.AgentSummary.Where(x => x.Id == Id).SingleOrDefault();
                localMSD3.AgentSummary.Remove(agentItem);
                TempData.Put(MSD3Key, localMSD3);
            }
            InitialisePage(LoggedInUser);
            MSD3VM = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD3Key] != null ? new MSD3ViewModel(TempData.GetKeep <MSD3ViewModel>(MSD3Key)) : new MSD3ViewModel();
        }
        private void AssignMSD1ToInput()
        {
            if (CustomExtensions.NotNullOrEmpty(TempData))
            {
                MSD1 = new MSD1(TempData.GetKeep <MSD1>(MSD1Key));

                Input.Year           = MSD1.Year.ToString();
                Input.Quarter        = MSD1.Quarter.ToString();
                Input.ReportingPort  = MSD1.ReportingPort;
                Input.IsInbound      = MSD1.IsInbound;
                Input.AssociatedPort = MSD1.AssociatedPort;
                Input.NumVoyages     = MSD1.NumVoyages.ToString();
                Input.RecordRef      = MSD1.RecordRef;
            }
        }
Example #25
0
        private void _characteristicControl_didSelectCellEvent(int arg2)
        {
            if (_selectedSong != null)
            {
                selectedCharacteristic = _selectedSong.beatmapCharacteristics[arg2];

                if (_selectedSong.beatmapLevelData != null)
                {
                    Dictionary <IDifficultyBeatmap, string> difficulties = _selectedSong.beatmapLevelData.difficultyBeatmapSets.First(x => x.beatmapCharacteristic == selectedCharacteristic).difficultyBeatmaps.ToDictionary(x => x, x => x.difficulty.ToString().Replace("Plus", "+"));

                    if (_selectedSong is CustomPreviewBeatmapLevel)
                    {
                        var songData = SongCore.Collections.RetrieveExtraSongData(SongCore.Collections.hashForLevelID(_selectedSong.levelID));
                        if (songData != null && songData._difficulties != null)
                        {
                            for (int i = 0; i < difficulties.Keys.Count; i++)
                            {
                                var diffKey = difficulties.Keys.ElementAt(i);

                                var difficultyLevel = songData._difficulties.FirstOrDefault(x => x._difficulty == diffKey.difficulty);
                                if (difficultyLevel != null && !string.IsNullOrEmpty(difficultyLevel._difficultyLabel))
                                {
                                    difficulties[diffKey] = difficultyLevel._difficultyLabel;
                                    Plugin.log.Debug($"Found difficulty label \"{difficulties[diffKey]}\" for difficulty {diffKey.difficulty.ToString()}");
                                }
                            }
                        }
                        else
                        {
                            Plugin.log.Warn($"Unable to retrieve extra data for song with hash \"{_selectedSong.levelID}\"!");
                        }
                    }

                    _difficultyControl.SetTexts(difficulties.Values.ToArray());

                    int closestDifficultyIndex = CustomExtensions.GetClosestDifficultyIndex(difficulties.Keys.ToArray(), selectedDifficulty);

                    _difficultyControl.SelectCellWithNumber(closestDifficultyIndex);

                    _difficultyControl_didSelectCellEvent(closestDifficultyIndex);
                }
            }
        }
Example #26
0
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                InitialisePage();
                return(Page());
            }

            MSD1 = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD1Key] != null ? new MSD1(TempData.GetKeep <MSD1>(MSD1Key)) : new MSD1();

            MSD1.AgentSenderID = Input.AgentSenderId.Split('-').FirstOrDefault().TrimEnd();
            MSD1.LineSenderID  = Input.LineSenderId.Split('-').FirstOrDefault().TrimEnd();

            MSD1.AgentCompanyName = Input.AgentSenderId.Split('-').LastOrDefault().TrimStart();
            MSD1.LineCompanyName  = Input.LineSenderId.Split('-').LastOrDefault().TrimStart();
            TempData.Put(MSD1Key, MSD1);

            return(RedirectToPage("./VesselDetails", new { FromSummary = FromSummary.ToString(), IsEdited = FromSummary.ToString() }));
        }
        public HttpResponseMessage Get(int idEvento)
        {
            var idOrganizacao = CustomExtensions.getIdOrganizacao();

            var DadosMapa = this.ConsultaBL.query(idOrganizacao)
                            .Where(x => x.idEvento == idEvento && x.ativo)
                            .OrderByDescending(x => x.id)
                            .Select(x => new {
                x.id,
                x.idEvento,
                x.conteudoMapa
            }).FirstOrDefault();

            var ORetorno = new DefaultDTO();

            ORetorno.listaResultados = DadosMapa;

            return(Request.CreateResponse(HttpStatusCode.OK, ORetorno));
        }
Example #28
0
        public void Awake()
        {
            if (Instance != this)
            {
                Instance = this;
                DontDestroyOnLoad(gameObject);

                Client.ClientCreated += ClientCreated;
                _currentScene         = SceneManager.GetActiveScene().name;

                _messageDisplayText = CustomExtensions.CreateWorldText(transform, "");
                transform.position  = new Vector3(0f, 3.75f, 3.75f);
                transform.rotation  = Quaternion.Euler(-30f, 0f, 0f);
                _messageDisplayText.overflowMode       = TextOverflowModes.Overflow;
                _messageDisplayText.enableWordWrapping = false;
                _messageDisplayText.alignment          = TextAlignmentOptions.Center;
                DontDestroyOnLoad(_messageDisplayText.gameObject);
            }
        }
        public async Task <HttpResponseMessage> Get(HttpRequestMessage request)
        {
            var RetornoApi = new DefaultDTO();

            try {
                var ViewModel = new EventoTabelaPrecoListagemVM {
                    idEvento      = UtilRequest.getInt32("idEvento"),
                    idOrganizacao = CustomExtensions.getIdOrganizacao()
                };

                if (ViewModel.idEvento <= 0)
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("A identificação do Evento deve ser informada");

                    return(Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                if (ViewModel.idOrganizacao <= 0)
                {
                    RetornoApi.flagErro = true;
                    RetornoApi.listaMensagens.Add("A identificação da organização deve ser informada");

                    return(Request.CreateResponse(HttpStatusCode.Forbidden, RetornoApi));
                }

                var Retorno = ViewModel.carregar();
                RetornoApi.flagErro = false;
                RetornoApi.listaMensagens.Add("Preços carregados com sucesso.");
                RetornoApi.listaResultados = Retorno.listaResultados;
                // RetornoApi.carregarDadosPaginacao(Retorno);

                return(Request.CreateResponse(HttpStatusCode.OK, RetornoApi));
            } catch (Exception ex) {
                var message = ex.getLogError($"Erro no serviço de consulta de tabela de preços.");

                RetornoApi.flagErro = true;
                RetornoApi.listaMensagens.Add(message);

                return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, RetornoApi));
            }
        }
Example #30
0
        void InitializeAvatarController()
        {
#if DEBUG
            Plugin.log.Info("Spawning avatar");
#endif
            centerAdjust = GameObject.FindObjectOfType <VRCenterAdjust>();

            avatarInput = new MultiplayerAvatarInput();

            avatar = AvatarManager.SpawnAvatar(defaultAvatarInstance, avatarInput);

            /*
             * exclusionScript = avatar.GameObject.GetComponentsInChildren<AvatarScriptPack.FirstPersonExclusion>().FirstOrDefault();
             * if (exclusionScript != null)
             *  exclusionScript.SetVisible();
             */

            playerNameText = CustomExtensions.CreateWorldText(transform, "INVALID");
            playerNameText.rectTransform.anchoredPosition3D = new Vector3(0f, 0.25f, 0f);
            playerNameText.alignment = TextAlignmentOptions.Center;
            playerNameText.fontSize  = 2.5f;

            playerSpeakerIcon = new GameObject("Player Speaker Icon", typeof(Canvas), typeof(CanvasRenderer)).AddComponent <Image>();
            playerSpeakerIcon.GetComponent <Canvas>().renderMode = RenderMode.WorldSpace;
            playerSpeakerIcon.rectTransform.SetParent(transform);
            playerSpeakerIcon.rectTransform.localScale         = new Vector3(0.004f, 0.004f, 1f);
            playerSpeakerIcon.rectTransform.pivot              = new Vector2(0.5f, 0.5f);
            playerSpeakerIcon.rectTransform.anchoredPosition3D = new Vector3(0f, 0.65f, 0f);
            playerSpeakerIcon.sprite = Sprites.speakerIcon;

            avatar.eventsPlayer.gameObject.transform.SetParent(centerAdjust.transform, false);
            transform.SetParent(centerAdjust.transform, false);

            if (ModelSaberAPI.cachedAvatars.Any(x => x.Value.fullPath == avatar.customAvatar.fullPath))
            {
                currentAvatarHash = ModelSaberAPI.cachedAvatars.First(x => x.Value.fullPath == avatar.customAvatar.fullPath).Key;
            }
            else
            {
                currentAvatarHash = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
            }
        }