コード例 #1
0
ファイル: Product.cs プロジェクト: sang-nm/mphc
        public void LoadNextPrevious(int languageId)
        {
            using (IDataReader reader = DBProduct.GetNextPreviousProduct(this.productID, this.zoneID, languageId))
            {
                if (reader.Read())
                {
                    if (reader["PreviousProductID"] != DBNull.Value)
                    {
                        this.previousProductId = Convert.ToInt32(reader["PreviousProductID"].ToString());
                    }
                    if (reader["NextProductID"] != DBNull.Value)
                    {
                        this.nextProductId = Convert.ToInt32(reader["NextProductID"].ToString());
                    }
                    if (reader["PreviousZoneID"] != DBNull.Value)
                    {
                        this.previousZoneId = Convert.ToInt32(reader["PreviousZoneID"].ToString());
                    }
                    if (reader["NextZoneID"] != DBNull.Value)
                    {
                        this.nextZoneId = Convert.ToInt32(reader["NextZoneID"].ToString());
                    }
                    if (reader["PreviousProductUrl"] != DBNull.Value)
                    {
                        this.previousProductUrl = reader["PreviousProductUrl"].ToString();
                    }
                    if (reader["PreviousProductTitle"] != DBNull.Value)
                    {
                        this.previousProductTitle = reader["PreviousProductTitle"].ToString();
                    }
                    if (reader["NextProductUrl"] != DBNull.Value)
                    {
                        this.nextProductUrl = reader["NextProductUrl"].ToString();
                    }
                    if (reader["NextProductTitle"] != DBNull.Value)
                    {
                        this.nextProductTitle = reader["NextProductTitle"].ToString();
                    }

                    if (reader["IsFirstProduct"] != DBNull.Value)
                    {
                        this.isFirstProduct = Convert.ToBoolean(reader["IsFirstProduct"]);
                    }
                    if (reader["IsLastProduct"] != DBNull.Value)
                    {
                        this.isLastProduct = Convert.ToBoolean(reader["IsLastProduct"]);
                    }
                }
            }
        }