Example #1
0
        private void btnCihazDuzenle_Click(object sender, EventArgs e)
        {
            string isim     = txtCihazAdi.Text;
            string adres    = txtIP.Text;
            string port     = txtSSHPort.Text;
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            if (String.IsNullOrEmpty(isim) || String.IsNullOrEmpty(adres) || String.IsNullOrEmpty(port) || String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password) || port == "0")
            {
                MessageBox.Show(res_man.GetString("txtTumAlanlarDoldur", cul));
            }
            else
            {
                cihaz.CihazAdi = isim;
                cihaz.Adres    = adres;
                cihaz.Port     = Convert.ToInt32(port);
                cihaz.Username = username;
                cihaz.Password = password;
                cihaz.Tip      = (rndFortigate.Checked) ? Turu.Fortigate : Turu.Fortimail;
                islemler islem = new islemler();

                Result r = islem.CihazD(cihaz);
                if (r.success)
                {
                    MessageBox.Show(r.mesaj);
                    anaForm.ListeyiGuncelle();
                }
                else
                {
                    MessageBox.Show(r.mesaj);
                }
            }
        }
Example #2
0
        private void SilClick(object sender, ListViewColumnMouseEventArgs e)
        {
            CihazList clist = islemler.GetAllCihazlar();
            var       item  = listCihazlar.SelectedItems[0];

            var cihaz = clist.cihazlar.Where(c => c.ID.ToString().Equals(e.Item.SubItems[0].Text)).FirstOrDefault();

            if (cihaz != null)
            {
                DialogResult myResult;
                myResult = MessageBox.Show(res_man.GetString("txtSilinsinmi", cul), res_man.GetString("txtSil", cul), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (myResult == DialogResult.OK)
                {
                    islemler islem = new islemler();
                    Result   r     = islem.CihazS(cihaz);
                    if (r.success)
                    {
                        MessageBox.Show(r.mesaj);
                        ListeyiGuncelle();
                    }
                    else
                    {
                        MessageBox.Show(r.mesaj);
                    }
                }
            }
        }