private bool AddItemToCart(int title_id, string sku, int quantity, out AddResponse result) { result = AddResponse.Failure; bool success = false; //Duncan Working CartDB db = new CartDB(); DataSet ds = db.CartProductGetBySKU(sku); if (ds == null) return false; bool is_bulk = false, is_student = false; using (DataTableReader data = ds.CreateDataReader()) { while (data.Read()) { is_bulk = data.GetInt32(data.GetOrdinal("IsBulk")) == 1; is_student = data.GetInt32(data.GetOrdinal("IsStudent")) == 1; break; } } if (is_bulk) { result |= AddResponse.Bulk; return false; } success = db.CartAddSKU(CurrentCart.CartId, sku, quantity); if (success) { result = AddResponse.Success; } if (is_student) { result |= AddResponse.Student; } return success; }