CeErpOrganization.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Castle.ActiveRecord;
  2. using System.Data;
  3. namespace BizCom
  4. {
  5. [ActiveRecord("CE_ErpOrganization")]
  6. public class CeErpOrganization : DicSysBase
  7. {
  8. public CeErpOrganization()
  9. {
  10. rootName = "组织机构";
  11. titleName = "组织机构根结点";
  12. tableName = "CE_ErpOrganization";
  13. }
  14. [Property]
  15. public new string pemShop
  16. {
  17. get { return _pemShop; }
  18. set { _pemShop = value; }
  19. }
  20. public static DataTable Get()
  21. {
  22. string sql = "select * from ce_erporganization order by parentid,sort asc";
  23. return DbConn.ExecuteDataset(sql).Tables[0];
  24. }
  25. public static DataTable Get(int orgId)
  26. {
  27. string sql = string.Format("select * from ce_erporganization where id={0} or path like '%|{0}|%' order by parentid,sort asc", orgId);
  28. return DbConn.ExecuteDataset(sql).Tables[0];
  29. }
  30. public static DataTable GetSite()
  31. {
  32. string sql = "select id,name from ce_erporganization where parentid=0 order by sort asc";
  33. return DbConn.ExecuteDataset(sql).Tables[0];
  34. }
  35. }
  36. }