sync.run.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_runinfo()
  13. {
  14. DataStruct dStruct = GetStruct();
  15. List<string> lw = new List<string>();
  16. string key = GetPostString("key");
  17. if (key.Length > 0) lw.Add(string.Format("title like '%{0}%'", key));
  18. dStruct.Order = "id desc";
  19. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  20. DataTable dt = WebCache.GetData("view_runinfo", dStruct);
  21. writeGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt));
  22. }
  23. public void del_runinfo()
  24. {
  25. if (UrlParmsCheck("eid"))
  26. {
  27. int eid = GetInt("eid");
  28. SRunInfo.Del(eid);
  29. returnSuccessMsg("删除成功");
  30. }
  31. }
  32. public void save_runinfo()
  33. {
  34. if (UrlPostParmsCheck("type,con"))
  35. {
  36. int eid = GetPostInt("eid");
  37. string name = GetPostString("name");
  38. int type = GetPostInt("type");
  39. string con = GetPostString("con");
  40. con = con.Replace("\n", "<br>");
  41. SRunInfo entity = null;
  42. if (eid > 0) entity = SRunInfo.Get(eid);
  43. else entity = new SRunInfo();
  44. entity.Title = name;
  45. entity.Con = con;
  46. entity.TypeID = type;
  47. entity.UpdTime = DateTime.Now;
  48. if (eid > 0) entity.Update();
  49. else entity.Create();
  50. returnSuccessMsg("保存成功!");
  51. }
  52. }
  53. }
  54. }