| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Castle.ActiveRecord;
- using System.Data;
- namespace BizCom
- {
- [ActiveRecord("CE_ErpOrganization")]
- public class CeErpOrganization : DicSysBase
- {
- public CeErpOrganization()
- {
- rootName = "组织机构";
- titleName = "组织机构根结点";
- tableName = "CE_ErpOrganization";
- }
- [Property]
- public new string pemShop
- {
- get { return _pemShop; }
- set { _pemShop = value; }
- }
- public static DataTable Get()
- {
- string sql = "select * from ce_erporganization order by parentid,sort asc";
- return DbConn.ExecuteDataset(sql).Tables[0];
- }
- public static DataTable Get(int orgId)
- {
- string sql = string.Format("select * from ce_erporganization where id={0} or path like '%|{0}|%' order by parentid,sort asc", orgId);
- return DbConn.ExecuteDataset(sql).Tables[0];
- }
- public static DataTable GetSite()
- {
- string sql = "select id,name from ce_erporganization where parentid=0 order by sort asc";
- return DbConn.ExecuteDataset(sql).Tables[0];
- }
- }
- }
|