예제 #1
0
        public ReportTemplate SaveTemplate(ReportTemplate template)
        {
            if (template == null)
            {
                throw new ArgumentNullException("template");
            }

            if (template.CreateOn == default(DateTime))
            {
                template.CreateOn = TenantUtil.DateTimeNow();
            }
            if (string.IsNullOrEmpty(template.CreateBy))
            {
                template.CreateBy = SecurityContext.CurrentAccount.ID.ToString();
            }
            return(reportDao.SaveTemplate(template));
        }
예제 #2
0
        public ReportTemplate SaveTemplate(ReportTemplate template)
        {
            if (template == null)
            {
                throw new ArgumentNullException("template");
            }

            if (ProjectSecurity.IsVisitor(SecurityContext.CurrentAccount.ID))
            {
                throw new SecurityException("Access denied.");
            }

            if (template.CreateOn == default(DateTime))
            {
                template.CreateOn = TenantUtil.DateTimeNow();
            }
            if (template.CreateBy.Equals(Guid.Empty))
            {
                template.CreateBy = SecurityContext.CurrentAccount.ID;
            }
            return(reportDao.SaveTemplate(template));
        }