Esempio n. 1
0
        public BlockModel GetBlockBySection(string section)
        {
            try
            {
                var datas              = new List <FontBlockViewModel>();
                var blockStore         = new BlockStore();
                var dt                 = blockStore.GetBlockBySection(section);
                var listFrontModelTab1 = new FontBlockViewModel();
                var model              = new BlockModel();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    model = new BlockModel()
                    {
                        ID       = int.Parse(dt.Rows[i]["BLOCK_ID"].ToString()),
                        TITLE    = dt.Rows[i]["BLOCK_TITLE"].ToString(),
                        CONTENT  = dt.Rows[i]["BLOCK_CONTENT"].ToString(),
                        TAB      = dt.Rows[i]["BLOCK_TAB"].ToString(),
                        POSITION = dt.Rows[i]["BLOCK_POSITION"].ToString(),
                        STATUS   = dt.Rows[i]["BLOCK_STATUS"].ToString().Trim() == "1"
                    };
                }
                return(model);
            }

            catch (Exception ex)
            {
                return(null);
            }
        }