Esempio n. 1
0
        private async void DadosTesteAtual_Load(object sender, EventArgs e)
        {
            FocusMe();

            lblTemperatura.Text = TemperatureSubscriber.Temperature + " °C";

            metroComboBox1.SelectedIndex = I18nUtils.GetComboLangSelectedIndex();
            metroComboBox2.SelectedIndex = 0;
            metroTextBox1.Focus();
            metroGrid1.UseSelectable = false;
            labelUsername.Text       = Properties.Settings.Default.Username;

            ChangePanelVisibility(false);

            if (Properties.Settings.Default.IsOffline)
            {
                TesteTermicoDTO    = LocalFiberService.GetUltimoTesteTermicoSalvoNoArquivo();
                metroTextBox1.Text = TesteTermicoDTO.CodigoRequisicao.Split('/')[0];
                timerCheckFiber.Start();

                AtualizaListaTestes();
                ChangeAllButtons(false);
            }
            else
            {
                if (LocalFiberService.IsNecessarioSincronizar())
                {
                    ChangeAllButtons(false);
                    Loading loading = new Loading
                    {
                        Titulo = GetI18nMessage("sincronizandoTestes")
                    };

                    loading.Show();

                    Task task = new Task(SincronizarTestes);
                    task.Start();
                    await task;

                    ChangeAllButtons(true);
                    loading.Close();
                }
            }
        }
Esempio n. 2
0
 private string GetI18nMessage(string messageCode)
 {
     return(I18nUtils.GetStringMessage(this, messageCode));
 }