using CurrenciesDAL.Models;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Threading.Tasks;
public static class ColoursManager
public static Colour GetColour(int colourId, string name)
using (SqlConnection conn = DB.GetConnection())
using (SqlCommand cmd = new SqlCommand())
cmd.CommandText = "SELECT * FROM Colours WHERE Id = " +colourId + "AND name = " + name + ";";
SqlDataReader reader = cmd.ExecuteReader();
c.Id = reader.GetInt32(0);
c.Name = reader.GetString(1);
public static List<Colour> GetColourList(int Id, string name)
List<Colour> colours = new List<Colour>();
using (SqlConnection conn = DB.GetConnection())
using (SqlCommand cmd = new SqlCommand())
cmd.CommandText = "SELECT * FROM Colours WHERE Id = " +colourId + "AND name = " + name + ";";
SqlDataReader reader = cmd.ExecuteReader();
Colour colour = new Colour();
colour.Id = reader.GetInt32(0);
colour.Name = reader.GetString(1);