Ejemplo n.º 1
0
        public FrontItemsModel GetItemObject(int itemID, Languages langID)
        {
            FrontItemsModel item = null;

            using (SqlConnection myConnection = GetSqlConnection())
            {
                SqlCommand myCommand = new SqlCommand("dbo.New_Items_GetOneByID", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                // Set the parameters
                myCommand.Parameters.Add("@ItemID", SqlDbType.Int, 4).Value = itemID;
                myCommand.Parameters.Add("@LangID", SqlDbType.Int, 4).Value = (int)langID;
                //---------------------------------------------------------------------
                //---------------------------------------------------------------------
                // Execute the command
                myConnection.Open();
                using (SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (dr.Read())
                    {
                        item = (FrontItemsModel)GetEntity(dr, typeof(FrontItemsModel));
                    }
                    dr.Close();
                }
                myConnection.Close();
                return(item);
            }
        }
Ejemplo n.º 2
0
        public void BuilDetailsPathesLinks(ItemsModulesOptions currentModule, FrontItemsModel currentItem)
        {
            string homeText    = (string)HttpContext.GetGlobalResourceObject("Modules", "_Home");
            string moduleTitle = currentModule.GetModuleTitle();

            this.AddLink(homeText, "/");
            this.AddLink(moduleTitle, string.Format("/{0}/all", currentModule.Identifire));
            this.AddLastTitle(currentItem.Title);
            this.PageTitle = currentItem.Title;
            this.TopHeader = moduleTitle;
        }
Ejemplo n.º 3
0
        //-----------------------------------------------------------
        public void LoadItem()
        {
            //------------------------------------------------------------------------
            Languages langID = SiteSettings.GetCurrentLanguage();

            RequiredItem = FrontItemsController.GetItemObject(ItemID, langID);
            if (RequiredItem != null && RequiredItem.IsAvailable)
            {
                this.Visible = true;
            }
            else
            {
                this.Visible = false;
            }
            //----------------------------------------------
        }