コード例 #1
0
 public void InsertMiniExcursion(MiniExcursionDao MiniExcursion)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         connection.Execute(
             StoredProcedures.Insert,
             new
         {
             MiniExcursion.libelleMiniExcursion,
             MiniExcursion.nombrePlaceMiniExcursion
         },
             commandType: CommandType.StoredProcedure);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }