Exemple #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var dc = new ClassSRMDataContext(Config.connection);

            if (gridView1.RowCount != 0)
            {
                int id = (int)gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Id");
                dc.DeleteUser(id);
                txtPass.Text     = string.Empty;
                txtUserName.Text = string.Empty;
                XtraMessageBox.Show("حساب کاربری با موفقیت حذف شد", "توجه", MessageBoxButtons.OK, MessageBoxIcon.Information);
                EditAccount_Load(null, null);
            }
            else
            {
                XtraMessageBox.Show("حسابی برای حذف وجود ندارد", "توجه", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }