@@ -56,7 +56,7 @@ public LotteryOutlet GetDefaultLotteryOutlet()
5656 {
5757 command . CommandType = CommandType . Text ;
5858 command . CommandText = "SELECT * FROM lottery_outlet WHERE outlet_cd = @outlet_cd AND active = true ORDER BY description ASC" ;
59- command . Parameters . AddWithValue ( "@outlet_cd" , ResourcesUtils . LotteryOutletDefaultCode ) ;
59+ command . Parameters . Add ( "@outlet_cd" , OleDbType . Integer ) . Value = ResourcesUtils . LotteryOutletDefaultCode ;
6060 command . Connection = conn ;
6161 conn . Open ( ) ;
6262
@@ -79,9 +79,9 @@ public void UpdateDescription(LotteryOutlet updatedModel)
7979 command . CommandType = CommandType . Text ;
8080 command . CommandText = " UPDATE lottery_outlet SET description = @description " +
8181 " WHERE ID = @id AND outlet_cd = @outlet_cd AND active = true" ;
82- command . Parameters . AddWithValue ( "@description" , StringUtils . Truncate ( updatedModel . GetDescription ( ) , MAX_LEN_DESCRIPTION ) ) ;
83- command . Parameters . AddWithValue ( "@id" , updatedModel . GetId ( ) ) ;
84- command . Parameters . AddWithValue ( "@outlet_cd" , updatedModel . GetOutletCode ( ) ) ;
82+ command . Parameters . Add ( "@description" , OleDbType . Variant ) . Value = StringUtils . Truncate ( updatedModel . GetDescription ( ) , MAX_LEN_DESCRIPTION ) ;
83+ command . Parameters . Add ( "@id" , OleDbType . Integer ) . Value = updatedModel . GetId ( ) ;
84+ command . Parameters . Add ( "@outlet_cd" , OleDbType . Integer ) . Value = updatedModel . GetOutletCode ( ) ;
8585 command . Connection = conn ;
8686 conn . Open ( ) ;
8787 OleDbTransaction transaction = conn . BeginTransaction ( ) ;
@@ -105,7 +105,7 @@ public bool IsLotteryOutletUsed(int outletCd)
105105 command . CommandText = "SELECT count(ID) AS [total] FROM lottery_bet " +
106106 " WHERE outlet_cd = @outlet_cd " +
107107 " AND active = true " ;
108- command . Parameters . AddWithValue ( "@outlet_cd" , outletCd ) ;
108+ command . Parameters . Add ( "@outlet_cd" , OleDbType . Integer ) . Value = outletCd ;
109109 command . Connection = conn ;
110110 conn . Open ( ) ;
111111 using ( OleDbDataReader reader = command . ExecuteReader ( ) )
@@ -135,9 +135,9 @@ public void RemoveOutlet(LotteryOutlet modelToRemove)
135135 command . CommandText = " UPDATE lottery_outlet SET active = false " +
136136 " WHERE ID = @id AND outlet_cd = @outlet_cd " +
137137 " AND description = @outlet_desc AND active = true " ;
138- command . Parameters . AddWithValue ( "@id" , modelToRemove . GetId ( ) ) ;
139- command . Parameters . AddWithValue ( "@outlet_cd" , modelToRemove . GetOutletCode ( ) ) ;
140- command . Parameters . AddWithValue ( "@outlet_desc" , modelToRemove . GetDescription ( ) ) ;
138+ command . Parameters . Add ( "@id" , OleDbType . Integer ) . Value = modelToRemove . GetId ( ) ;
139+ command . Parameters . Add ( "@outlet_cd" , OleDbType . Integer ) . Value = modelToRemove . GetOutletCode ( ) ;
140+ command . Parameters . Add ( "@outlet_desc" , OleDbType . Variant ) . Value = modelToRemove . GetDescription ( ) ;
141141 command . Connection = conn ;
142142 conn . Open ( ) ;
143143 OleDbTransaction transaction = conn . BeginTransaction ( ) ;
@@ -161,7 +161,7 @@ public bool IsDescriptionExisting(String outletDescription)
161161 command . CommandText = "SELECT count(ID) AS [total] FROM lottery_outlet " +
162162 " WHERE description = @outletDescription " +
163163 " AND active = true " ;
164- command . Parameters . AddWithValue ( "@outletDescription" , outletDescription ) ;
164+ command . Parameters . Add ( "@outletDescription" , OleDbType . Variant ) . Value = outletDescription ;
165165 command . Connection = conn ;
166166 conn . Open ( ) ;
167167 using ( OleDbDataReader reader = command . ExecuteReader ( ) )
@@ -195,8 +195,8 @@ public int InsertLotteryOutlet(String outletDescription)
195195 command . CommandType = CommandType . Text ;
196196 command . CommandText = " INSERT INTO `lottery_outlet` (`outlet_cd`, `description`, `active`) " +
197197 " VALUES(@nextOutletCode, @outletDescription, true)" ;
198- command . Parameters . AddWithValue ( "@nextOutletCode" , nextOutletCode ) ;
199- command . Parameters . AddWithValue ( "@outletDescription" , StringUtils . Truncate ( outletDescription , MAX_LEN_DESCRIPTION ) ) ;
198+ command . Parameters . Add ( "@nextOutletCode" , OleDbType . Integer ) . Value = nextOutletCode ;
199+ command . Parameters . Add ( "@outletDescription" , OleDbType . Variant ) . Value = StringUtils . Truncate ( outletDescription , MAX_LEN_DESCRIPTION ) ;
200200
201201 command . Connection = conn ;
202202 conn . Open ( ) ;
0 commit comments