GetCommon.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Ant.Data;
  2. using Ant.ORM;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. namespace ChangFa.Machinery.WebPage
  9. {
  10. public class GetCommon
  11. {
  12. public static string GetReportItem(string id, string sepid)
  13. {
  14. string itemstr = "";
  15. string strsql = @"SELECT b.SmallEventName from YW_MatchReport as a LEFT JOIN YW_ProjectEntry as b on a.PEID=b.ID where a.SporterID='" + id + "' and a.SEPID='" + sepid + "'";
  16. using (AntORM orm = new AntORM())
  17. {
  18. try
  19. {
  20. orm.db = DataAccessFactory.CreateDataConnection("CyclingItem");
  21. RequestItemSqlModel request = new RequestItemSqlModel
  22. {
  23. newSt = new SqlNote() { Author = "季健国", NewSt = new System.Diagnostics.StackTrace(true), SqlDesc = "查询赛事的单个实体方法" },
  24. };
  25. request.StrSql = strsql;
  26. var result = orm.GetDataTableList(request);
  27. if (result.IsSuccess)
  28. {
  29. foreach (DataRow dr in result.DataTable.Rows)
  30. {
  31. itemstr = (itemstr.IsEmpty()) ? dr[0].ToString() : itemstr + ";" + dr[0].ToString();
  32. }
  33. }
  34. }
  35. catch (Exception ex)
  36. {
  37. }
  38. }
  39. return itemstr;
  40. }
  41. }
  42. }