public void InsertMiniExcursion(MiniExcursionDao MiniExcursion) { using (var connection = new SqlConnection(connectionString)) { connection.Execute( StoredProcedures.Insert, new { MiniExcursion.libelleMiniExcursion, MiniExcursion.nombrePlaceMiniExcursion }, commandType: CommandType.StoredProcedure); } }
public MiniExcursionDao GetExcursionById(int id) { MiniExcursionDao miniExcursionDao = null; using (var connection = new SqlConnection(connectionString)) { miniExcursionDao = connection.QueryFirstOrDefault <MiniExcursionDao>( StoredProcedures.SelectById, new { idMiniExcursion = id }, commandType: CommandType.StoredProcedure); } return(miniExcursionDao); }
public int UpdateMiniExcursion(MiniExcursionDao MiniExcursion) { int affectedRows = 0; using (var connection = new SqlConnection(connectionString)) { affectedRows = connection.Execute( StoredProcedures.Update, new { MiniExcursion.idMiniExcursion, MiniExcursion.libelleMiniExcursion, MiniExcursion.nombrePlaceMiniExcursion }, commandType: System.Data.CommandType.StoredProcedure); } return(affectedRows); }