Example #1
0
        protected void Button30_Click(object sender, EventArgs e)
        {
            BDepartment bus     = new BDepartment();
            Department  rootDep = bus.GetDepartmentsTree();

            //IList<Department> list = bus.GetAll();
            GetDepChilds(rootDep /*, list*/);
        }
Example #2
0
 public Department GetDepartmentRoot()
 {
     try
     {
         return(bDep.GetDepartmentsTree());
     }
     catch (Exception ex)
     {
         LogException(ex, "BFlow", "GetDepartmentRoot");
         throw ex;
     }
 }
Example #3
0
 /// <summary>
 /// ریشه درخت را برمیگرداند
 /// </summary>
 /// <returns></returns>
 public Department GetDepartmentRoot()
 {
     try
     {
         BDepartment busDep = new BDepartment();
         return(busDep.GetDepartmentsTree());
     }
     catch (Exception ex)
     {
         LogException(ex, "BPrivateMessage", "GetDepartmentRoot");
         throw ex;
     }
 }
 public void GetDepartmentTreeMoreRootFailTest()
 {
     try
     {
         departmentTA.InsertQuery("root", "0-root", 0, "", "");
         busDep.GetDepartmentsTree();
         Assert.Fail("Two root must be exception caused");
     }
     catch (InvalidDatabaseStateException ex)
     {
         Assert.AreEqual(ex.ExceptionType, UIExceptionTypes.Fatal);
         Assert.AreEqual(ex.FatalExceptionIdentifier, UIFatalExceptionIdentifiers.DepartmentRootMoreThanOne);
     }
     finally
     {
         departmentTA.DeleteByCustomCode("0-root");
     }
 }