private void btnSave_Click(object sender, RoutedEventArgs e) { if (cmbColumns.SelectedItem == null) { MessageBox.Show("ستون معادل انتخاب نشده است"); return; } if (cmbRole.SelectedItem == null) { MessageBox.Show("نفش معادل انتخاب نشده است"); return; } if (cmbOperator.SelectedItem == null) { MessageBox.Show("عملگر معادل انتخاب نشده است"); return; } if (Message == null) { Message = new EntityRoleSecurityDirectDTO(); } Message.TableDrivedEntityID = EntityID; Message.ColumnID = (int)cmbColumns.SelectedValue; var selected = cmbRole.SelectedItem as RoleOrRoleGroupDTO; if (selected.Type == RoleOrRoleGroupType.Role) { Message.RoleID = (int)cmbRole.SelectedValue; Message.RoleGroupID = 0; } else { Message.RoleID = 0; Message.RoleGroupID = (int)cmbRole.SelectedValue; } if (optDBFunction.IsChecked == true) { Message.Value = ""; Message.DBFunctionID = (int)cmbDatabaseFunction.SelectedValue; } else { Message.DBFunctionID = 0; Message.Value = txtValue.Text; } Message.Operator = (EntitySecurityOperator)cmbOperator.SelectedItem; bizRoleSecurity.UpdateEntityRoleSecurityDirect(Message); MessageBox.Show("اطلاعات ثبت شد"); }
public frmEntityRoleSecurityDirect(int entityID, int entityRoleSecurityDirectId) { InitializeComponent(); EntityID = entityID; EntityRoleSecurityDirectID = entityRoleSecurityDirectId; if (entityRoleSecurityDirectId != 0) { GetEntityRoleSecurityDirect(EntityRoleSecurityDirectID); } else { Message = new EntityRoleSecurityDirectDTO(); } SetRoles(); SetDatabaseFunctions(); SetColumns(); SetOperators(); ShowMessage(); }
private void GetEntityRoleSecurityDirect(int id) { Message = bizRoleSecurity.GetEntityRoleSecurityDirect(id, false); ShowMessage(); }