/// <summary> /// 查询所有单位 /// </summary> /// <returns></returns> public List <IUnits> QueryUnits() { IUnits nit = entityfactory.CreateEntityInstance <IUnits>(); IDvTable dvt = entityfactory.CreateDriveTable(nit); DataSet ds = dvt.Select(); List <IUnits> uitlist = this.dh.Convert <IUnits>(nit.GetType(), ds); return(uitlist); }
/// <summary> /// 根据单位编码查询单位 /// </summary> /// <param name="UnitCode"></param> /// <returns></returns> public IUnits QueryUnitsForCode(long UnitCode) { IUnits uit = entityfactory.CreateEntityInstance <IUnits>(); IDvTable dvt = entityfactory.CreateDriveTable(uit); uit.UnitCode = UnitCode; dvt.WhereClause("UnitCode", Operator.Deng, LinkOperator.nul); DataSet ds = dvt.Select(); uit = this.dh.Convert <IUnits>(uit.GetType(), ds, 0); return(uit); }