Example #1
0
        public void GetDepartmentChilds_Test()
        {
            IList <Department> list = busflow.GetDepartmentChilds(ADORoot.ID, ADOFlow1.ID);

            Assert.AreEqual(1, list.Count);
            Assert.IsTrue(list.Where(x => x.ID == ADODepartment1.ID).Count() == 1);
            Assert.IsTrue(list.Where(x => x.ID == ADODepartment2.ID).Count() == 0);
        }
Example #2
0
        /// <summary>
        /// بصورت بازگشتی درحت را پیمایش و شرط نمایش را بررسی میکند
        ///  اگر تشخیص داده شد که گره ای نباید نشان داده شود نیازی به پیمایش گره های فرزند نیست
        ///  زیرا این تشخیص شامل آنها نیز میشود
        /// </summary>
        /// <param name="department"></param>
        /// <param name="visibleIds"></param>
        private void SetVisibility(Department department, Flow flow, IList <Department> containsChildList)
        {
            BFlow bFlow = new BFlow();

            //IList<decimal> restrictionIds = accessPort.GetAccessibleDeparments();
            if (department.ChildList != null)
            {
                foreach (Department child in department.ChildList)
                {
                    if (!containsChildList.Contains(child))
                    {
                        child.Visible = child.Visible || false;//ممکن است در جریانهای قبلی مقدار یک گرفته باشد
                    }
                    else
                    {
                        child.Visible = true;
                        this.SetVisibility(child, flow, bFlow.GetDepartmentChilds(child.ID, flow.ID));
                    }
                }
            }
        }