public List<UserICatRate> getUserICatRate_ByUserID(string UserID) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("@UserID", UserID); string strSelect = "SELECT [UserID] ,[ItemCategoryID] ,[MeansRate] FROM [RS].[TEMP_USER_ICAT_RATE] WHERE [UserID] = @UserID "; SqlDataReader dr = executeReader(strSelect, parameters); List<UserICatRate> list = new List<UserICatRate>(); while (dr.Read()) { UserICatRate obj = new UserICatRate(); obj.UserID = dr.GetString(dr.GetOrdinal("UserID")); obj.ItemCategoryID = dr.GetString(dr.GetOrdinal("ItemCategoryID")); obj.MeansRate = dr.GetDouble(dr.GetOrdinal("MeansRate")); list.Add(obj); } dr.Close(); return list; }
public void addUserICatRate(UserICatRate obj) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("@UserID", obj.UserID); parameters.Add("@ItemCategoryID", obj.ItemCategoryID); parameters.Add("@MeansRate", obj.MeansRate); executeNonQuery("INSERT INTO [RS].[TEMP_USER_ICAT_RATE] ([UserID] ,[ItemCategoryID] ,[MeansRate]) VALUES (@UserID ,@ItemCategoryID ,@MeansRate)", parameters); }