示例#1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("هل تريد حذف هذا المستخدم", "Super Market", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int id = Convert.ToInt32(this.dgUser.CurrentRow.Cells[0].Value);
                    classUser.DeleteUser(id);
                    MessageBox.Show("تم حذف المستخدم", "Super market", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    DataPreview();
                }
            }
            catch
            {
                return;
            }
        }