Esempio n. 1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(DVValues.SelectedId) == false)
            {
                var genericCRUD = LastCRUD;

                if (UserCRUD.CheckIfUserLastAdmin(_lastType, DVValues.SelectedId))
                {
                    MessageBox.Show("Yalnızca 1 adet yönetici kaldığı için, bu kullanıcıyı silemezsiniz.",
                                    "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (MessageBox.Show("Emin misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) ==
                         DialogResult.Yes)
                {
                    genericCRUD.Delete(DVValues.SelectedId);
                    RefreshDataGridView();
                }
            }
        }