public override IList <RuleCategory> GetAll() { IList <decimal> ids = accessPort.GetAccessibleRuleGroups(); IList <RuleCategory> list = new List <RuleCategory>(); list = RuleCategoryRep.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new RuleCategory().ID), ids.ToArray(), CriteriaOperation.IN)); return(list); }
public IList <RuleCategory> GetRuleCategoryChilds(decimal parentId) { try { IList <decimal> accessableIDs = accessPort.GetAccessibleRuleGroups(); IList <RuleCategory> list = new List <RuleCategory>(); RuleCategory ruleCatAlias = null; GTS.Clock.Model.Temp.Temp tempAlias = null; if (accessableIDs.Count < this.operationBatchSizeValue && this.operationBatchSizeValue < 2100) { list = RuleCategoryRep.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new RuleCategory().ParentId), parentId), new CriteriaStruct(Utility.GetPropertyName(() => new RuleCategory().ID), accessableIDs.ToArray(), CriteriaOperation.IN), new CriteriaStruct(Utility.GetPropertyName(() => new RuleCategory().SubSystemId), SubSystemIdentifier.TimeAtendance)); } else { string operationGUID = this.bTemp.InsertTempList(accessableIDs); list = NHSession.QueryOver(() => ruleCatAlias) .JoinAlias(() => ruleCatAlias.TempList, () => tempAlias) .Where(() => tempAlias.OperationGUID == operationGUID && ruleCatAlias.ParentId == parentId && ruleCatAlias.SubSystemId == SubSystemIdentifier.TimeAtendance) .List <RuleCategory>(); this.bTemp.DeleteTempList(operationGUID); } // IList<ReportParameter> parameters = reportParameterRep.GetAll(); //foreach (RuleCategory report in list) //{ // if (report.IsReport && !report.IsDesignedReport) // { // report.HasParameter = this.HasReportParameter(report.ReportFile.ID, parameters); // } // if (report.IsDesignedReport) // report.HasParameter = true; //} List <RuleCategory> result = new List <RuleCategory>(); result.AddRange(list.Where(x => x.IsGroup).OrderBy(x => x.IsGroup)); result.AddRange(list.Where(x => !x.IsGroup).OrderBy(x => x.IsGroup)); return(result); } catch (Exception ex) { LogException(ex, "BRulesGroup", "GetRulesGroupChilds"); throw ex; } }
/// <summary> /// شناسه گروه قانون بمنظور استفاده در عملیات دریافت میگردد /// </summary> /// <param name="ruleCategoryId"></param> public BRuleViewer(decimal ruleCategoryId) { RuleCategoryRepository repository = new RuleCategoryRepository(false); IList <RuleCategory> list = repository.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new RuleCategory().ID), ruleCategoryId)); if (list.Count == 1) { workingRuleCategory = list[0]; } else { UIValidationExceptions exception = new UIValidationExceptions(); exception.Add(ExceptionResourceKeys.RuleCategoryIdIsInValid, "پارامتر ارسال شده معرف دسته قانون نمیباشد", ExceptionSrc); throw exception; } }