private void OnButtonActionClick(object sender, ListViewColumnMouseEventArgs e) { CihazList clist = islemler.GetAllCihazlar(); var cihaz = clist.cihazlar.Where(c => c.ID.ToString().Equals(e.Item.SubItems[0].Text)).FirstOrDefault(); if (cihaz != null) { frmDuzenle UForm = IsFormAlreadyOpen(typeof(frmDuzenle)); if (UForm == null) { UForm = new frmDuzenle(); UForm.cihaz = cihaz; UForm.cihazGetir(); UForm.anaForm = this; UForm.Show(); } else { UForm.cihaz = cihaz; UForm.cihazGetir(); UForm.anaForm = this; UForm.Show(); UForm.Focus(); UForm.WindowState = FormWindowState.Normal; } } }
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); } } } }