//
        // GET: /ArticleTag/

        public ActionResult Index()
        {
            DataOperator dop = new DataOperator(Runtime.SqlConfig);
            List<ArticleTag> list = new List<ArticleTag>();
            list = dop.Select<ArticleTag>();
            return View(list);
        }
 public ActionResult GetLatest(string store)
 {
     DataOperator dop = new DataOperator(config);
     var result = dop.Select<BackUpInfo>(new BackUpInfo(), "", "BackUpTime DESC", 1, 0);
     if (result != null && result.Count > 0)
     {
         var latest = result[0];
         return Content(latest.FileName);
     }
     return Content("");
 }
 public ActionResult DoDelete(string categoryName)
 {
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     dop.Delete(categoryName);
     Article mArticle = new Article();
     mArticle.ACategoryName = categoryName;
     var list = dop.Select(mArticle, "", "", 10, 0);     //cms系统要改
     foreach(var item in list)
     {
         var article = item as Article;
         article.ACategoryName = "0";
         dop.Update(article);
     }
     TemplateDataHelper.Categories = null;
     return Redirect("/Admin/Success.do");
 }
        public ActionResult Manager(string key, string pageIndex)
        {
            ViewBag.Key = key;
            ViewBag.PageIndex = pageIndex;
            List<Article> list = new List<Article>();

            key = string.IsNullOrEmpty(key) ? "" : key;
            pageIndex = string.IsNullOrEmpty(pageIndex) ? "1" : pageIndex;

            DataOperator dop = new DataOperator(Runtime.SqlConfig);
            Article article = new Article();
            article.ATitle = key;
            list = dop.Select<Article>(article, "", "ATime DESC", 10, (int.Parse(pageIndex) - 1) * 10);

            return View(list);
        }
        public static List<Category> GetCategories()
        {
            if (Categories != null)
                return Categories;

            List<Category> list = new List<Category>();
            Category category = new Category();
            DataOperator dop = new DataOperator(Runtime.SqlConfig);
            var result = dop.Select(category, "CategoryName<>'recycle' and CategoryName<>'root'", "", 0, 0);
            foreach (var item in result)
            {
                list.Add(item as Category);
            }

            Categories = list;
            return list;
        }
 public static List<Article> GetCategoryArticles(string categoryName)
 {
     List<Article> list = new List<Article>();
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     var result = dop.Select<Article>(new Article(), "ACategoryName='" + categoryName + "'", "ATime DESC", 10, 0);
     foreach (var item in result)
     {
         list.Add(item);
     }
     return list;
 }
 public static List<Article> GetIndexArticles()
 {
     List<Article> list = new List<Article>();
     DataOperator dop = new DataOperator(Runtime.SqlConfig);
     var result = dop.Select<Article>(new Article(), "", "ATime DESC", 10, 0);
     foreach(var item in result)
     {
         list.Add(item);
     }
     return list;
 }