public virtual List <Company.Structures.ResponsibilitiesReport.ResponsibilitiesReportTableLine> GetResponsibilitiesReportData(Company.IEmployee employee) { var result = new List <Company.Structures.ResponsibilitiesReport.ResponsibilitiesReportTableLine>(); // HACK: Получаем отображаемое имя модуля. // Dmitriev_IA: Данные из модуля ExchangeCode должны попасть в таблицу модуля Компания. var companyModuleMetadata = Sungero.Metadata.Services.MetadataSearcher.FindModuleMetadata(Company.PublicConstants.Module.ModuleGuid); var moduleName = companyModuleMetadata.GetDisplayName(); var modulePriority = Company.PublicConstants.ResponsibilitiesReport.ExchangePriority; // Цифровые сертификаты. if (Certificates.AccessRights.CanRead()) { var certificateResponsibility = Company.Reports.Resources.ResponsibilitiesReport.CertificateResponsibility; var certificates = Certificates.GetAll() .Where(x => Equals(x.Owner, employee)) .Where(d => d.Enabled.HasValue && d.Enabled.Value) .Where(d => !d.NotAfter.HasValue || d.NotAfter.Value > Calendar.Now); result = Company.PublicFunctions.Module.AppendResponsibilitiesReportResult(result, certificates, moduleName, modulePriority, certificateResponsibility, null); } // Ответственный за абонентские ящики наших организаций. if (BoxBases.AccessRights.CanRead()) { var boxResponsibility = Company.Reports.Resources.ResponsibilitiesReport.BoxResponsibility; var boxes = BoxBases.GetAll() .Where(x => Equals(x.Responsible, employee)) .Where(d => d.Status == Sungero.CoreEntities.DatabookEntry.Status.Active); result = Company.PublicFunctions.Module.AppendResponsibilitiesReportResult(result, boxes, moduleName, modulePriority, boxResponsibility, null); } return(result); }
public static IQueryable <ICertificate> GetCertificatesOfEmployee(IEmployee employee) { return(Certificates.GetAll(x => Equals(x.Owner, employee))); }