public void DeletePermission(Permission permission) { using (SPKTDataContext spktDC = conn.GetContext()) { spktDC.Permissions.Attach(permission, true); spktDC.Permissions.DeleteOnSubmit(permission); spktDC.SubmitChanges(); } }
public void AddPermission(Account account, Permission permission) { using (SPKTDataContext spktDC = conn.GetContext()) { AccountPermission ap = new AccountPermission(); ap.AccountID = account.AccountID; ap.PermissionID = permission.PermissionID; spktDC.AccountPermissions.InsertOnSubmit(ap); spktDC.SubmitChanges(); } }
partial void DeletePermission(Permission instance);
partial void UpdatePermission(Permission instance);
partial void InsertPermission(Permission instance);
public void AddPermission(Permission permission) { _permissions.Add(permission); }
public void SavePermission(Permission permission) { using (SPKTDataContext spktDC = conn.GetContext()) { if (permission.PermissionID > 0) { spktDC.Permissions.Attach(permission, true); } else { spktDC.Permissions.InsertOnSubmit(permission); } spktDC.SubmitChanges(); } }