public ReportTemplateWrapper SaveReportTemplate(string name, string period, int periodItem, int hour, bool autoGenerated, ReportType reportType,
                                         int tag, int project, TaskStatus? status, Guid departament, Guid userId, ReportTimeInterval reportTimeInterval,
                                         ApiDateTime fromDate, ApiDateTime toDate, int viewType, bool noResponsible)
        {
            ProjectSecurity.DemandAuthentication();

            if (name == null || name.Trim().Length == 0) throw new ArgumentNullException("name");

            var filter = new TaskFilter
            {
                TagId = tag,
                DepartmentId = departament,
                UserId = userId,
                TimeInterval = reportTimeInterval,
                FromDate = fromDate,
                ToDate = toDate,
                ViewType = viewType,
                NoResponsible = noResponsible
            };

            if (project != 0)
                filter.ProjectIds.Add(project);

            if (status != null)
                filter.TaskStatuses.Add((TaskStatus)status);

            var template = new ReportTemplate(reportType) { Filter = filter };

            SaveOrUpdateTemplate(template, name, period, periodItem, hour, autoGenerated);

            return new ReportTemplateWrapper(template);
        }
Esempio n. 2
0
        public ReportTemplateWrapper SaveReportTemplate(
            string name,
            string period,
            int periodItem,
            int hour,
            bool autoGenerated,
            ReportType reportType,
            int tag,
            int project,
            TaskStatus?status,
            Guid departament,
            Guid userId,
            ReportTimeInterval reportTimeInterval,
            ApiDateTime fromDate,
            ApiDateTime toDate,
            int viewType,
            bool noResponsible)
        {
            ProjectSecurity.DemandAuthentication();

            if (name == null || name.Trim().Length == 0)
            {
                throw new ArgumentNullException("name");
            }

            var filter = new TaskFilter
            {
                TagId         = tag,
                DepartmentId  = departament,
                UserId        = userId,
                TimeInterval  = reportTimeInterval,
                FromDate      = fromDate,
                ToDate        = toDate,
                ViewType      = viewType,
                NoResponsible = noResponsible
            };

            if (project != 0)
            {
                filter.ProjectIds.Add(project);
            }

            if (status != null)
            {
                filter.TaskStatuses.Add((TaskStatus)status);
            }

            var template = new ReportTemplate(reportType)
            {
                Filter = filter
            };

            SaveOrUpdateTemplate(template, name, period, periodItem, hour, autoGenerated);
            MessageService.Send(Request, MessageAction.ReportTemplateCreated, template.Name);

            return(new ReportTemplateWrapper(template));
        }
Esempio n. 3
0
        public ReportTemplateWrapper UpdateReportTemplate(
            int reportid,
            string name,
            string period,
            int periodItem,
            int hour,
            bool autoGenerated,
            ReportType reportType,
            int tag,
            int project,
            TaskStatus?status,
            Guid departament,
            Guid userId,
            ReportTimeInterval reportTimeInterval,
            ApiDateTime fromDate,
            ApiDateTime toDate,
            int viewType,
            bool noResponsible)
        {
            ProjectSecurity.DemandAuthentication();

            var filter = new TaskFilter
            {
                TagId         = tag,
                DepartmentId  = departament,
                UserId        = userId,
                TimeInterval  = reportTimeInterval,
                FromDate      = fromDate,
                ToDate        = toDate,
                ViewType      = viewType,
                NoResponsible = noResponsible
            };

            if (project != 0)
            {
                filter.ProjectIds.Add(project);
            }

            if (status != null)
            {
                filter.TaskStatuses.Add((TaskStatus)status);
            }

            var template = EngineFactory.GetReportEngine().GetTemplate(reportid);

            template.Filter = filter;

            SaveOrUpdateTemplate(template, name, period, periodItem, hour, autoGenerated);
            MessageService.Send(Request, MessageAction.ReportTemplateUpdated, template.Name);

            return(new ReportTemplateWrapper(template));
        }
        public ReportTemplateWrapper UpdateReportTemplate(
            int reportid,
            string name,
            string period,
            int periodItem,
            int hour,
            bool autoGenerated,
            ReportType reportType,
            int tag,
            int project,
            TaskStatus? status,
            Guid departament,
            Guid userId,
            ReportTimeInterval reportTimeInterval,
            ApiDateTime fromDate,
            ApiDateTime toDate,
            int viewType,
            bool noResponsible)
        {
            ProjectSecurity.DemandAuthentication();

            var filter = new TaskFilter
                {
                    TagId = tag,
                    DepartmentId = departament,
                    UserId = userId,
                    TimeInterval = reportTimeInterval,
                    FromDate = fromDate,
                    ToDate = toDate,
                    ViewType = viewType,
                    NoResponsible = noResponsible
                };

            if (project != 0)
            {
                filter.ProjectIds.Add(project);
            }

            if (status != null)
            {
                filter.TaskStatuses.Add((TaskStatus)status);
            }

            var template = EngineFactory.GetReportEngine().GetTemplate(reportid);
            template.Filter = filter;

            SaveOrUpdateTemplate(template, name, period, periodItem, hour, autoGenerated);
            MessageService.Send(Request, MessageAction.ReportTemplateUpdated, template.Name);

            return new ReportTemplateWrapper(template);
        }