コード例 #1
0
        private void FormConfiguration_Load(object sender, EventArgs e)
        {
            OpSQLlite conn = new OpSQLlite();

            if (conn.ExistConf())
            {
                textBoxOriginDoc.Text = conn.Getconfiguration(2);
                textBoxTimeSAP.Text   = conn.Getconfiguration(3);
                textBoxFieldKey.Text  = conn.Getconfiguration(4);
                textBoxQueueName.Text = conn.Getconfiguration(1);
                textBoxTimeStart.Text = conn.Getconfiguration(5);
                textBoxTimeEnd.Text   = conn.Getconfiguration(6);
                if (textBoxTimeStart.Text is null)
                {
                    checkBox1.Checked = false;
                }
                else
                {
                    textBoxTimeEnd.Text = "";
                }
                //if (String.Compare(conn.Getconfiguration(7)., "false"))
                //{

                //    checkImport.Checked = false;
                //}
                //else
                //{
                //    checkImport.Checked = true;

                //}
            }

            conn.CloseConnection();
        }
コード例 #2
0
ファイル: Sync.cs プロジェクト: erivelton2612/LB1
        private void Sync_Load(object sender, EventArgs e)
        {
            notifyIcon1.BalloonTipText  = "Application minimized";
            notifyIcon1.BalloonTipTitle = "Liber B1 Sync";
            //verificar se há conexao
            OpSQLlite sQLlite = new OpSQLlite();

            //verifica se existe connexao
            connSAPLiber = new Connection();
            //if (!connSAPLiber.hasConn)
            if (!sQLlite.ExistConn())
            {
                button1.Enabled = false;
                button2.Enabled = false;
                toolStripStatusLabel3.BackColor = Color.Red;
                toolStripStatusLabel3.Text      = "Sem Conexão.";
                label1TimeSAP.Text = "Temporizador não configurado";
                label1.Text        = "";
                label2.Text        = "";
                label3.Text        = "";
            }
            else
            {
                toolStripStatusLabel3.BackColor = Color.Green;
                toolStripStatusLabel3.Text      = "Conectado.";
                //verifica se existe configuração
                cfg = new Configuration();
                if (sQLlite.ExistConf())
                {
                    if (cfg.TimeSAP < 2)
                    {
                        timer1.Enabled = false;
                    }
                    else
                    {
                        timer1.Interval = cfg.TimeSAP * 60 * 1000;
                    }

                    timer1.Start();
                    DateTime otherDate = DateTime.Now.AddMilliseconds(cfg.TimeSAP * 60 * 1000);
                    label1TimeSAP.Text = otherDate.ToLongTimeString();

                    DateTime otherDate2 = DateTime.Now.AddMilliseconds(10 * 60 * 1000);
                    label3.Text = otherDate2.ToLongTimeString();
                    MyLogger.Log("------------------------------------------------------------------------------------------------");
                    MyLogger.Log("Aguardando novas iterações...");
                }
                else
                {
                    label1TimeSAP.Text = "Temporizador não configurado";
                    label3.Text        = "";
                }
            }
        }