public static void RegistrarPermisoRol(Permiso_X_Rol _permiso_x_rol) { try { ConsultasAd.RegistrarPermisoRol(_permiso_x_rol); } catch (Exception ex) { throw ex; } }
public static void RegistrarPermisoRol(Permiso_X_Rol _permiso_x_rol) { try { using (SqlConnection con = DataBaseManager.OpenSqlDatabase(user, pass, servidor, baseDatos)) { using (SqlCommand command = con.CreateCommand()) { command.CommandText = "sp_permiso_rol"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@ID_ROL", _permiso_x_rol.Rol.Id_rol); command.Parameters.AddWithValue("@ID_PERMISO", _permiso_x_rol.Rol.Id_rol); command.ExecuteNonQuery(); } } } catch (Exception ex) { throw ex; } }