public void fnsave()
{
int i = 0;
bool status = false;
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (Convert.ToBoolean(String.IsNullOrEmpty(row.Cells["AllowAction"].Value.ToString().Trim()) ?
"False" : row.Cells["AllowAction"].Value.ToString()))
{
string modulename = row.Cells["ModuleName"].Value.ToString();
status = true;
i = user.SavePermission(Convert.ToInt32(cmbPermissions.SelectedValue), modulename,
Convert.ToBoolean(row.Cells["AllowAction"].Value.ToString()));
}
if (i > 0)
{
MessageBox.Show("Permission Details Added Successfully");
}
else
{
status = false;
}
}
}
private void btnUpdate_Click(object sender, EventArgs e)
{
fnsave();
}
Asked
Active
Viewed 432 times
0

Arion
- 31,011
- 10
- 70
- 88

user3171911
- 21
- 5
-
What the question is? – Fabio Jan 09 '14 at 08:43
-
:) so what not working in your code? – Fabio Jan 09 '14 at 09:15
-
Did you get error or what? Why it is not working? Is `user.SavePermission` do your database update? Or if you checking `if AllowAction = true`, then update all row, then show code where you trying update all row's values... – Fabio Jan 09 '14 at 14:12