Пример #1
0
        private void btnAddMaticni_Click(object sender, EventArgs e)
        {
            if (txtMaticniBroj.Text.Trim() == "" || txtMaticniBroj.Text.Trim().Length != 8)
            {
                MessageBox.Show("...");
                return;
            }
            DBCommOsnovnePostavke.connection = new SqlConnection(DBBlokadeData.connectionString);
            DBCommOsnovnePostavke.connection.Open();

            DBCommOsnovnePostavke.addMaticniBrojUNadgledane(monitoring.idMonitoring, txtMaticniBroj.Text.Trim());
            DBCommOsnovnePostavke.connection.Close();
            ucitajMaticneBrojeve();
        }
Пример #2
0
        private void btnAddMaticniFile_Click(object sender, EventArgs e)
        {
            int i = 1;

            DBCommOsnovnePostavke.connection = new SqlConnection(DBBlokadeData.connectionString);
            DBCommOsnovnePostavke.connection.Open();
            string[] ss = File.ReadAllText(txtFilePath.Text.Trim()).Split('\n');
            foreach (string s in ss)
            {
                if (s.Trim() != "" && s.Trim().Length == 8)
                {
                    DBCommOsnovnePostavke.addMaticniBrojUNadgledane(monitoring.idMonitoring, s.Trim());
                    txtConsole.Text = "Ubacen maticni: " + i++ + "/" + ss.Length;
                }
            }
            DBCommOsnovnePostavke.connection.Close();
        }