Esempio n. 1
0
        private void btSalvar_Click(object sender, EventArgs e)
        {
            Configuration config = Firebird.ReturnConfiguration();

            if (cbMin.Checked)
            {
                config.ListMin = 1;
            }
            else
            {
                config.ListMin = 0;
            }
            if (cbMax.Checked)
            {
                config.ListMax = 1;
            }
            else
            {
                config.ListMax = 0;
            }
            config.ListMinColor = ColorTranslator.ToHtml(btnMin.BackColor);
            config.ListMaxColor = ColorTranslator.ToHtml(btnMax.BackColor);
            Firebird.SaveConfig(config);

            form2.PaintMinMax();
            MessageBox.Show("Configurações alteradas com sucesso!", "Sucesso!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
Esempio n. 2
0
        public void Loading()
        {
            var config = Firebird.ReturnConfiguration();

            cbMin.Checked    = config.ListMin == 1;
            cbMax.Checked    = config.ListMax == 1;
            btnMin.BackColor = ColorTranslator.FromHtml(config.ListMinColor);
            btnMax.BackColor = ColorTranslator.FromHtml(config.ListMaxColor);
        }
Esempio n. 3
0
        private void CheckBoxes()
        {
            var config = Firebird.ReturnConfiguration();

            cbValores.Checked = config.GraphValues == 1;
            cbMedio.Checked   = config.GraphMedio == 1;
            cbMin.Checked     = config.GraphMin == 1;
            cbMax.Checked     = config.GraphMax == 1;
        }
Esempio n. 4
0
        private void btSalvar_Click(object sender, EventArgs e)
        {
            var config = Firebird.ReturnConfiguration();

            if (cbValores.Checked)
            {
                config.GraphValues = 1;
            }
            else
            {
                config.GraphValues = 0;
            }
            if (cbMedio.Checked)
            {
                config.GraphMedio = 1;
            }
            else
            {
                config.GraphMedio = 0;
            }
            if (cbMin.Checked)
            {
                config.GraphMin = 1;
            }
            else
            {
                config.GraphMin = 0;
            }
            if (cbMax.Checked)
            {
                config.GraphMax = 1;
            }
            else
            {
                config.GraphMax = 0;
            }

            config.GraphValuesColor   = ColorTranslator.ToHtml(btnValores.BackColor);
            config.GraphMedioColor    = ColorTranslator.ToHtml(btnMedio.BackColor);
            config.GraphMinColor      = ColorTranslator.ToHtml(btnMin.BackColor);
            config.GraphMaxColor      = ColorTranslator.ToHtml(btnMax.BackColor);
            config.GraphLeiturasColor = ColorTranslator.ToHtml(btnLeituras.BackColor);

            if (Firebird.SaveConfig(config))
            {
                MessageBox.Show("Configurações salvas com sucesso!", "Sucesso!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Erro ao salvar as configurações!", "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 5
0
        private void Header()
        {
            lbLabel.Text = string.Format("Máquina {0} Lote Nº {1} com {2} Leituras", lote.Maquina, lote.NumLote, lote.NumeroLeit);
            lbMin.Text   = (lote.Min / 10).ToString();
            lbMedio.Text = (lote.Medio / 10).ToString();
            lbMax.Text   = (lote.Max / 10).ToString();

            var config = Firebird.ReturnConfiguration();

            btnValores.BackColor  = ColorTranslator.FromHtml(config.GraphValuesColor);
            btnMedio.BackColor    = ColorTranslator.FromHtml(config.GraphMedioColor);
            btnMin.BackColor      = ColorTranslator.FromHtml(config.GraphMinColor);
            btnMax.BackColor      = ColorTranslator.FromHtml(config.GraphMaxColor);
            btnLeituras.BackColor = ColorTranslator.FromHtml(config.GraphLeiturasColor);
        }
Esempio n. 6
0
        public void PaintMinMax()
        {
            var config = Firebird.ReturnConfiguration();

            string Min = lbMin.Text;
            string Max = lbMax.Text;

            for (int i = 0; i < listView.Items.Count; i++)
            {
                listView.Items[i].BackColor = Color.White;
                if (listView.Items[i].SubItems[5].Text == Min && config.ListMin == 1)
                {
                    listView.Items[i].BackColor = ColorTranslator.FromHtml(config.ListMinColor);
                }
                if (listView.Items[i].SubItems[5].Text == Max && config.ListMax == 1)
                {
                    listView.Items[i].BackColor = ColorTranslator.FromHtml(config.ListMaxColor);
                }
            }
        }