Пример #1
0
 public void Delete_Test()
 {
     try
     {
         busReport.SaveChanges(ADOReport1, UIActionType.DELETE);
         ClearSession();
         report_testObject = busReport.GetByID(ADOReport1.ID);
         Assert.Fail("Item is not deleted");
     }
     catch (ItemNotExists ex)
     {
         Assert.Pass(ex.Message);
     }
 }
Пример #2
0
 IList <decimal> IDataAccess.GetAccessibleReports()
 {
     if (userRepository.HasAllReportAccess(this.CurrentUserId) > 0)
     {
         IList <Report> list = new EntityRepository <Report>().GetAll();
         var            ids  = from obj in list
                               select obj.ID;
         return(ids.ToList <decimal>());
     }
     else
     {
         BReport        bReport             = new BReport();
         List <decimal> reportList          = new List <decimal>();
         List <decimal> childAndParentsList = new List <decimal>();
         reportList.AddRange(userRepository.GetUserReportIdList(this.CurrentUserId));
         foreach (decimal reportId in reportList)//اضافه کردن بچه ها و والد ها
         {
             IList <Report> childs = new List <Report>();
             childs = bReport.GetReportChildsByParentPath(reportId);
             childAndParentsList.AddRange(bReport.GetByID(reportId).ParentPathList);
             var ids = from child in childs
                       select child.ID;
             childAndParentsList.AddRange(ids.ToList <decimal>());
         }
         reportList.AddRange(childAndParentsList);
         return(reportList);
     }
 }