public bool DeleteDeliveredReport(object deleteReport)
        {
            UserRptOutput userReportOutput = JavaScriptConvert.DeserializeObject <UserRptOutput>(JavaScriptConvert.SerializeObject(deleteReport));

            if (userReportOutput != null)
            {
                var file = Path.Combine(FileServerPath, UserContext.UserID, userReportOutput.FileName);

                try
                {
                    if (File.Exists(file))
                    {
                        File.Delete(file);
                    }
                }
                catch
                {
                    return(false);
                }

                try
                {
                    ReportDomainService service = new ReportDomainService();
                    service.DeleteDeliveredReport(userReportOutput);
                }
                catch
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        public bool DeleteDeliveredReport(string userId, UserRptOutput userReportOutput)
        {
            var file = Path.Combine(FileServerPath, userId, userReportOutput.FileName);

            try
            {
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }
            catch
            {
                return(false);
            }

            try
            {
                ReportDomainService service = new ReportDomainService();
                service.DeleteDeliveredReport(userReportOutput);
            }
            catch
            {
                return(false);
            }

            return(true);
        }