Ejemplo n.º 1
0
 /// <summary>
 /// برای بایند شدن درخت در هنگام باز کردن گره این تابع استفاده میشود
 /// </summary>
 /// <param name="parentId"></param>
 /// <param name="pageSize"></param>
 /// <param name="pageIndex"></param>
 /// <returns>JSON فرمت</returns>
 public IList <OrganizationUnit> GetChilds(decimal parentId)//, int pageSize, int pageIndex)
 {
     try
     {
         IList <decimal>          accessableIDs    = accessPort.GetAccessibleOrgans();
         OrganizationUnit         organizationUnit = new OrganizationUnit();
         IList <OrganizationUnit> list             = organizationUnitRepository.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new OrganizationUnit().Parent), new OrganizationUnit()
         {
             ID = parentId
         }),
                                                                                              new CriteriaStruct(Utility.GetPropertyName(() => new OrganizationUnit().ID), accessableIDs.ToArray(), CriteriaOperation.IN));
         return(list);
     }
     catch (Exception ex)
     {
         LogException(ex, "BOrganizationUnit", "GetChilds");
         throw ex;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// زیر گره های یک گره را برمیگرداند
        /// </summary>
        /// <param name="organId">کلید اصلی پست</param>
        /// <returns>لیست پست سازمانی</returns>
        public IList <OrganizationUnit> GetOrganizationChildsWithoutDA(decimal organId)
        {
            try
            {
                IList <OrganizationUnit> organList = new List <OrganizationUnit>();

                organList = organizationUnitRepository
                            .GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new OrganizationUnit().Parent), new OrganizationUnit()
                {
                    ID = organId
                }));


                return(organList);
            }
            catch (Exception ex)
            {
                LogException(ex, "BOrganizationUnit", "GetDepartmentChildsWithoutDA");
                throw ex;
            }
        }