예제 #1
0
 public bool InsertTrip_Container(Trips_Containers ourTrip_Container)
 {
     using (IDbConnection conn = Connection)
     {
         conn.Open();
         int rowsAffected = conn.Execute(@"INSERT INTO Trips_Containers([TripId],[ContainerId],[ContainerPriority]) 
     values (@TripId, @ContainerId,@ContainerPriority)",
                                         new { ourTrip_Container.TripId, ourTrip_Container.ContainerId, ourTrip_Container.ContainerPriority });
         if (rowsAffected > 0)
         {
             return(true);
         }
         return(false);
     }
 }
예제 #2
0
        public bool UpdateByPriority(Trips_Containers ourTrip_Container)
        {
            using (IDbConnection conn = Connection)
            {
                conn.Open();
                int rowsAffected = conn.Execute(@"UPDATE [Trips_Containers] SET [ContainerPriority]=@ContainerPriority" +
                                                " WHERE ContainerId = " + ourTrip_Container.ContainerId + " AND TripId = " + ourTrip_Container.TripId, ourTrip_Container);

                if (rowsAffected > 0)
                {
                    return(true);
                }
                return(false);
            }
        }
예제 #3
0
 public bool UpdateByPriority([FromBody] Trips_Containers ourTrip_Container)
 {
     return(_Trips_ContainersRepo.UpdateByPriority(ourTrip_Container));
 }
예제 #4
0
 public bool UpdateByContainerId([FromBody] Trips_Containers ourTrip_Container)
 {
     return(_Trips_ContainersRepo.UpdateByContainerId(ourTrip_Container));
 }
예제 #5
0
 public bool Create([FromBody] Trips_Containers ourTrip_Container)
 {
     return(_Trips_ContainersRepo.InsertTrip_Container(ourTrip_Container));
 }