Ejemplo n.º 1
0
        private void btnServer_Click(object sender, EventArgs e)
        {
            cmbDatabase.Properties.Items.Clear();
            bool state = false;

            try
            {
                System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();

                if (ping.Send(txtServer.Text).Status == System.Net.NetworkInformation.IPStatus.Success)
                {
                    state = true;
                }
            }
            catch (Exception ex)
            {
                MessageErrorDialog error = new MessageErrorDialog("Destinacija!?", "Ping destinacije nije uspio! Provjerite IP.", ex.ToString());
                error.ShowDialog();
            }


            if (state)
            {
                //Helpers.Reader.GetDatabases(ref cmbDatabase, cmbServer, txtLogin.Text, txtPassword.Text);

                Helpers.Reader.GetDestDatabases(ref cmbDatabase, txtServer.Text, txtLogin.Text, txtPassword.Text);
                btnServer.Text = "VPN ok!";
                btnServer.Appearance.BackColor = Color.DarkSeaGreen;
            }
            else
            {
                btnServer.Text = "VPN??";
                btnServer.Appearance.BackColor = Color.IndianRed;
            }
        }
Ejemplo n.º 2
0
        private void btnBuildConnString_Click(object sender, EventArgs e)
        {
            if (txtServer.Text == String.Empty || cmbDatabase.SelectedItem == null)
            {
                MessageErrorDialog error = new MessageErrorDialog("Nedostaju podaci", "Server i baza nisu odabrani.", null);
                error.ShowDialog();
                return;
            }

            memConnString.Text = "Data source=" + txtServer.Text + ";Initial Catalog=" + cmbDatabase.SelectedItem.ToString() + ";User ID=" + txtLogin.Text + ";Password=" + txtPassword.Text;
        }
Ejemplo n.º 3
0
        private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            int[]       selRows = ((GridView)gridResults.MainView).GetSelectedRows();
            DataRowView selRow  = (DataRowView)(((GridView)gridResults.MainView).GetRow(selRows[0]));

            if (selRow == null)
            {
                return;
            }

            Xml = selRow["DeadLockGraph"].ToString();


            try
            {
                if (System.IO.File.Exists(appPath + "\\data.xml"))
                {
                    //ako postoji obriši pa snimi
                    System.IO.File.Delete(appPath + "\\data.xml");
                    System.IO.File.WriteAllText(appPath + "\\data.xml", Xml);
                }
                else
                {
                    //samo snimi
                    System.IO.File.WriteAllText(appPath + "\\data.xml", Xml);
                }
            }
            catch (Exception ex)
            {
                MessageErrorDialog error = new MessageErrorDialog(".txt datoteka!?", "Pisanje xml-a u datoteku nije uspjelo.", ex.ToString());
                error.ShowDialog();
            }


            DataSet dataSet = new DataSet();

            dataSet.ReadXml(appPath + "\\data.xml");
            //treeDeadlock.DataSource = dataSet.Tables[0];
            gridControl1.DataSource = dataSet.Tables[0];
        }