Esempio n. 1
0
    public void btnSaveTablePermission_Clicked(object sender, EventArgs e)
    {
        MonkData db = new MonkData();
        Guid roleId = new Guid(hidRoleId.Value);
        var tablesWithSameName = from t in db.aspnet_TableUnderRoles
                                 where t.TableName == dlTables.SelectedValue && t.RoleId == roleId
                                 select t;
        if(tablesWithSameName.Count() > 0)
            return; // Found a table role assignment that was alredy created.
        Monks.aspnet_TableUnderRole tableUnderRole = new Monks.aspnet_TableUnderRole();
        tableUnderRole.RoleId = roleId;
        tableUnderRole.TableName = dlTables.SelectedValue;
        tableUnderRole.TableUnderRoleId = Guid.NewGuid();
        db.aspnet_TableUnderRoles.InsertOnSubmit(tableUnderRole);
        db.SubmitChanges();

        LoadRoles(db);
    }
Esempio n. 2
0
		private void detach_aspnet_TableUnderRoles(aspnet_TableUnderRole entity)
		{
			this.SendPropertyChanging();
			entity.aspnet_Role = null;
		}