public void CreatePermission(Permission permission) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_PermissionUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@PermissionID", 0); command.Parameters.AddWithValue("@PermissionName", permission.PermissionName); command.Parameters.AddWithValue("@Description", permission.Description); command.Parameters.AddWithValue("@Value", permission.Value); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Khong them duoc"); } command.Dispose(); } }
public void CreatePermission(Permission permission) { new PermissionDAO().CreatePermission(permission); }
public void UpdatePermission(Permission permission) { new PermissionDAO().UpdatePermission(permission); }