sync.news.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using BizCom;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace SiteCore.Handler
  9. {
  10. public partial class sync
  11. {
  12. public void get_newslist()
  13. {
  14. DataStruct dStruct = GetStruct();
  15. //dStruct.MainWhere = "state=3";
  16. //(datediff(d,isnull(dispatchtime,createtime),'" + dTime + "')=0 or
  17. //string eTime = GetPostString("eTime");
  18. IList<string> lw = new List<string>();
  19. //SetDateWhere("deliverytime", sTime, eTime, lw);
  20. string key = GetPostString("key");
  21. if (key.Length > 0)
  22. lw.Add(string.Format(" (title like '%{0}%')", key));
  23. if (lw.Count > 0) dStruct.SecondWhere = string.Join(" and ", lw.ToArray());
  24. dStruct.Order = "sort asc,addTime desc";
  25. //dStruct.Fileds = "*,(select count(0) from s_shopgoods where shopid=view_shop.id) as gnum";
  26. DataTable dt = WebCache.GetData("view_news", dStruct);
  27. writeGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt));
  28. }
  29. public void del_news()
  30. {
  31. if (UrlParmsCheck("nid"))
  32. {
  33. int nid = GetInt("nid");
  34. SNews.Del(nid);
  35. returnSuccessMsg("删除成功!");
  36. }
  37. }
  38. }
  39. }