Пример #1
0
        public List <VD_POST> getListPostByDate(DateTime fromDate, DateTime toDate, string categoryID)
        {
            List <VD_POST> lst = new List <VD_POST>();

            _DBAccess = new DBController();
            DataSet ds = new DataSet();

            ds = _DBAccess.GetListPostByDate("WEB_VD_GETLIST_POST_BY_CATEGORY_BY_DATE", fromDate, toDate, categoryID);
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        lst.Add(new VD_POST
                        {
                            ID                = Convert.ToInt64(row["ID"]),
                            CategoryID        = Convert.ToString(row["CategoryID"]),
                            CategoryName      = Convert.ToString(row["CategoryName"]),
                            MetaTitleCategory = Convert.ToString(row["MetaTitleCategory"]),
                            MainMenuID        = Convert.ToString(row["MainMenuID"]),
                            MainMenuName      = Convert.ToString(row["MainMenuName"]),
                            MetaTitleMainMenu = Convert.ToString(row["MetaTitleMainMenu"]),
                            SubMenuID         = Convert.ToString(row["SubMenuID"]),
                            SubMenuName       = Convert.ToString(row["SubMenuName"]),
                            MetaTitleSubMenu  = Convert.ToString(row["MetaTitleSubMenu"]),
                            TitlePost         = Convert.ToString(row["TitlePost"]),
                            ContentPost       = Convert.ToString(row["ContentPost"]),
                            CreatedBy         = Convert.ToString(row["CreatedBy"]),
                            CreatedDate       = Convert.ToDateTime(row["CreatedDate"]),
                            ChangeBy          = Convert.ToString(row["ChangeBy"]),
                            ChangeDate        = Convert.ToDateTime(row["ChangeDate"]),
                            IsPublish         = Convert.ToBoolean(row["IsPublish"]),
                            IsSlide           = Convert.ToBoolean(row["IsSlide"]),
                            IsHome            = Convert.ToBoolean(row["IsHome"]),
                            IsActive          = Convert.ToBoolean(row["IsActive"]),
                            Comment           = Convert.ToString(row["Comment"]),
                            ImagesDisplay     = Convert.ToString(row["ImagesDisplay"]),
                            ShortDescription  = Convert.ToString(row["ShortDescription"]),
                            MetaDescription   = Convert.ToString(row["MetaDescription"]),
                            MetaKeywords      = Convert.ToString(row["MetaKeywords"]),
                            MetaTitle         = Convert.ToString(row["MetaTitle"]),
                            AdminComment      = Convert.ToString(row["AdminComment"])
                        });
                    }
                }
            }

            return(lst);
        }