Пример #1
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            Data.Project project = GetBL <Logic.Business.Project.ProjectBL>().GetProject(ProjectId);
            if (project != null)
            {
                string sortExpression = gvItems.MasterTableView.SortExpressions.GetSortString();
                int    itemTypeId     = projectItemTypes.SelectedItemTypeId;
                budgetList.ItemTypeID = itemTypeId;

                BudgetSummaryReportParameters parameters = new BudgetSummaryReportParameters();
                parameters.SortExpression = sortExpression;
                parameters.ItemTypeId     = projectItemTypes.SelectedItemTypeId;
                parameters.UserId         = this.UserID;
                parameters.CultureName    = CultureName;
                parameters.ProjectId      = this.ProjectId;

                string fileName = string.Format("{0}_BudgetSummaryReport", project.ProjectName);

                string fileNameExtension;
                string encoding;
                string mimeType;

                byte[] reportBytes = UserWebReportHandler.GenerateBudgetSummaryReport(parameters, exportType,
                                                                                      out fileNameExtension, out encoding, out mimeType);
                Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
            }
        }
Пример #2
0
 /// <summary>
 /// Reports (submits a complain about) a user.
 /// </summary>
 /// <param name="userId">ID of the user about whom a complaint is being made</param>
 /// <param name="type">Type of complaint.</param>
 /// <param name="comment">Comment describing the complaint.</param>
 /// <returns>When executed successfully it returns True.</returns>
 public async Task <Response <bool> > Report(int userId, ReportTypes type, string comment = "")
 => await Request <bool>("report", new MethodParams
 {
     { "user_id", userId, true, UserIdsRange },
     { "type", type },
     { "comment", comment }
 });
Пример #3
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            Data.Project project     = GetBL <ProjectBL>().GetProject(ProjectId);
            string       cultureName = Support.GetCultureName(project.Country.CountryCode);

            TaskListReportParameters parameters = new TaskListReportParameters
            {
                CultureName    = cultureName,
                ProjectId      = this.ProjectId,
                SortExpression = taskList.TaskListSortExpression,
                TaskListId     = this.TaskListId,
                UserId         = this.UserID
            };

            var    shoppingList = GetBL <ItemBriefBL>().GetTaskListByTaskListId(this.TaskListId);
            string fileName     = string.Format("{0}_TaskList", shoppingList.Name);

            string fileNameExtension;
            string encoding;
            string mimeType;

            byte[] reportBytes = UserWebReportHandler.GenerateTaskListReport(parameters, exportType,
                                                                             out fileNameExtension, out encoding, out mimeType);
            Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
        }
Пример #4
0
        public void saveChannelsMetadata(ref ChannelsBundle _channelsBoundle, ReportTypes _reportType)
        {
            XDocument xdoc = getChannelsMetadata(ref _channelsBoundle);

            switch (_reportType)
            {
            case ReportTypes.JSON:
                break;

            case ReportTypes.XML:
                //Сохраняем xml-документ в файл
                xdoc.Save("ChannelsMetadata.xml");
                break;

            case ReportTypes.HTML:
                //создаем объект файла стилей xsl
                XslCompiledTransform xslt = new XslCompiledTransform();
                //заполняем его из файла
                xslt.Load(STYLESHEET_URI_STRING);
                //создаем обект записи, указываем ему имя выходного файла
                XmlTextWriter xmlTextWriter = new XmlTextWriter("ChannelsMetadata.html", null);
                //устанавливаем сохранение форматирования
                xmlTextWriter.Formatting = Formatting.Indented;
                //запускаем трансформацию с выводом в файл, который можно будет открыть в MS Word
                using (var xmlReader = xdoc.CreateReader())
                {
                    xslt.Transform(xmlReader, xmlTextWriter);
                }
                Console.WriteLine("Receive an HTML file!");
                break;

            default:
                break;
            }
        }
        private void Init()
        {
            worker.ReportProgress(0,
                string.Format(Properties.Resources.StartingEachReportMsg, this.filespec)
                );
            valid_VESTA = true;
            WorkbookWrapper bk = new WorkbookWrapper(this.filespec);
            if (bk == null)
            {
                worker.ReportProgress(0,
                    string.Format(Properties.Resources.InvalidWorksheetMsg, this.filespec)
                    );
                valid_VESTA = false;
                return;
            }

            this.sheet = bk.SheetByName(this.sheet_name);
            if (this.sheet == null)
            {
                worker.ReportProgress(0,
                    string.Format(Properties.Resources.SheetNotFoundInFileMsg, this.sheet_name, this.filespec)
                    );
                valid_VESTA = false;
                return;
            }
            this.report_type = VestaImporterUtils.ReportType(this.sheet);
            if (this.report_type == ReportTypes.Unknown)
            {
                worker.ReportProgress(0,
                    string.Format(Properties.Resources.UnknownReportTypeMsg, this.filespec)
                    );
                valid_VESTA = false;
                return;
            }
        }
Пример #6
0
 /// <summary>
 /// Sends a complaint to the item.
 /// </summary>
 /// <param name="ownerId">Identifier of an item owner community.</param>
 /// <param name="itemId">Item Id.</param>
 /// <param name="reason">Complaint reason.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task <Response <bool> > Report(int ownerId, int itemId, ReportTypes reason)
 => await Request <bool>("report", new MethodParams
 {
     { "owner_id", ownerId, true },
     { "item_id", itemId, true },
     { "reason", (int)reason, true }
 });
Пример #7
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            if (!this.IsFromSharedCompany)
            {
                Data.Item item = GetBL <InventoryBL>().GetItem(this.ItemId);
                if (item != null)
                {
                    ItemBookingListReportParameters parameters = new ItemBookingListReportParameters
                    {
                        ItemId         = this.ItemId,
                        SortExpression = gvBookingList.MasterTableView.SortExpressions.GetSortString(),
                        UserId         = this.UserID
                    };

                    string fileName = item.Name + "_Bookings";
                    string fileNameExtension;
                    string encoding;
                    string mimeType;

                    byte[] reportBytes = UserWebReportHandler.GenerateItemBookingListReport(parameters, exportType,
                                                                                            out fileNameExtension, out encoding, out mimeType);
                    Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
                }
            }
        }
Пример #8
0
 public IWorkspaceViewsProvider this[ReportTypes type]
 {
     get
     {
         return(_viewProviders[type]);
     }
 }
 public ReportQuery(string application, ReportTypes reportType, DateInterval interval, int numberOfResults)
 {
     Application = application;
     ReportType = reportType;
     Interval = interval;
     NumberOfResults = numberOfResults;
 }
Пример #10
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            string cultureName = string.Empty;

            Data.Project project = GetBL <Logic.Business.Project.ProjectBL>().GetProject(ProjectId);
            if (project != null)
            {
                cultureName = Support.GetCultureName(project.Country.CountryCode);

                string fileNameExtension;
                string encoding;
                string mimeType;
                string fileName = string.Format("{0}_Active_TaskList", project.ProjectName);

                ActiveTaskListReportParameters parameters = new ActiveTaskListReportParameters
                {
                    CultureName = cultureName,
                    ItemTypeId  = projectItemTypes.SelectedItemTypeId,
                    ProjectId   = ProjectId,
                    UserId      = this.UserID
                };

                byte[] reportBytes = UserWebReportHandler.GenerateActiveTaskListReport(parameters, exportType,
                                                                                       out fileNameExtension, out encoding, out mimeType);
                Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
            }
        }
Пример #11
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            int itemTypeId;

            int.TryParse(ddItemTypes.SelectedValue, out itemTypeId);
            string fileName = string.Empty;

            Data.Company company = GetBL <CompanyBL>().GetCompany(ViewingCompanyId);
            fileName = string.Format("{0}'s_Bookings", company.CompanyName);

            BookingDetailsReportParameters parameters = new BookingDetailsReportParameters
            {
                BookingId          = this.BookingId,
                BookingName        = GetBookingName(),
                CompanyId          = ViewingCompanyId,
                ContactPerson      = GetContactedPerson(),
                DisplayMode        = DisplayMode.ToString(),
                ItemTypeId         = itemTypeId,
                RelatedTable       = this.RelatedTableName,
                SortExpression     = gvBookingDetails.MasterTableView.SortExpressions.GetSortString(),
                UserId             = this.UserID,
                ShowMyBookingsOnly = chkMyBookingsOnly.Checked
            };

            string fileNameExtension;
            string encoding;
            string mimeType;

            byte[] reportBytes = UserWebReportHandler.GenerateBookingDetailsReport(parameters, exportType,
                                                                                   out fileNameExtension, out encoding, out mimeType, true);
            Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
        }
Пример #12
0
 public Duration(ReportTypes reportType)
 {
     DurationViewModel.Errors = 0;
     InitializeComponent();
     Messenger.Default.Send <ReportTypes>(reportType);
     Messenger.Reset();
 }
Пример #13
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            var project = GetBL <ProjectBL>().GetProject(this.ProjectId);

            if (project != null)
            {
                ItemisedPurchaseReportParameters parameters = new ItemisedPurchaseReportParameters
                {
                    CultureName    = this.CultureName,
                    ItemTypeId     = projectItemTypes.SelectedItemTypeId,
                    ProjectId      = this.ProjectId,
                    SortExpression = rgvItemisedPurchase.MasterTableView.SortExpressions.GetSortString(),
                    UserId         = this.UserID
                };

                string fileName = string.Format("{0}_ItemisedPurchaseReport", project.ProjectName);
                string fileNameExtension;
                string encoding;
                string mimeType;

                byte[] reportBytes = UserWebReportHandler.GenerateItemisedPurchaseReport(parameters, exportType,
                                                                                         out fileNameExtension, out encoding, out mimeType);
                Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
            }
        }
Пример #14
0
        private void SetReportStage(ReportStage reportStage)
        {
            this._currentReportStage = reportStage;

            var logMessage = string.Format(
                "ts:{0};logId:{1};clientId:{2};rptdDate:{3};reportType:{4};reportStage:{5}",
                DateTime.Now,
                this._rptlogId,
                this._clientId,
                this._rptdDate.ToString("yyyyMMdd"),
                this._currentReportType,
                this._currentReportStage);

            Console.WriteLine(logMessage);

            bool complete = false;

            // remove the current report type if it completed
            if (reportStage == ReportStage.LoadCompleted)
            {
                this._reportTypesToDownload = this._reportTypesToDownload.Except(this._currentReportType);
                // if there are no more report types to download then we are complete
                complete = this._reportTypesToDownload == ReportTypes.None;
            }

            Repository.UpdateReportLogStatus(this._rptlogId, this._currentReportType, this._currentReportStage, complete);
        }
Пример #15
0
        public frmReports(ReportTypes reportType, int dataSourceId = 0)
        {
            InitializeComponent();

            DataSourceId = dataSourceId;

            reportViewerAttributes.Dock            = DockStyle.Fill;
            reportViewerDataSources.Dock           = DockStyle.Fill;
            reportViewerAttributesParentChild.Dock = DockStyle.Fill;
            reportViewerAttributesParentChild.LocalReport.EnableExternalImages = true;


            ReportParameter p1 = new ReportParameter("UserName", Information.LoggedInUser.UserName);

            string image = "file:///" + GetImageFileName();

            reportViewerAttributes.LocalReport.SetParameters(p1);
            reportViewerDataSources.LocalReport.SetParameters(new ReportParameter[] { p1 });
            reportViewerAttributesParentChild.LocalReport.SetParameters(p1);
            //reportViewerAttributesParentChild.LocalReport.SetParameters(new ReportParameter("MapImage", @"file:///C:\temp\Map_Arrow.png"));
            reportViewerAttributesParentChild.LocalReport.SetParameters(new ReportParameter("MapImage", image));

            ReportType = reportType;
            BindData();
        }
Пример #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReportConfiguration"/> class.
        /// </summary>
        /// <param name="reportFiles">The report files.</param>
        /// <param name="targetDirectory">The target directory.</param>
        /// <param name="reportTypes">The report types.</param>
        /// <param name="sourceDirectories">The source directories.</param>
        /// <param name="filters">The filters.</param>
        /// <param name="verbosityLevel">The verbosity level.</param>
        public ReportConfiguration(
            IEnumerable <string> reportFiles,
            string targetDirectory,
            IEnumerable <string> reportTypes,
            IEnumerable <string> sourceDirectories,
            IEnumerable <string> filters,
            string verbosityLevel)
        {
            if (reportFiles == null)
            {
                throw new ArgumentNullException("reportFiles");
            }

            if (targetDirectory == null)
            {
                throw new ArgumentNullException("targetDirectory");
            }

            if (reportTypes == null)
            {
                throw new ArgumentNullException("reportTypes");
            }

            if (sourceDirectories == null)
            {
                throw new ArgumentNullException("sourceDirectories");
            }

            if (filters == null)
            {
                throw new ArgumentNullException("filters");
            }

            this.ReportFiles     = reportFiles;
            this.TargetDirectory = targetDirectory;

            if (reportTypes.Any())
            {
                foreach (var reportType in reportTypes)
                {
                    ReportTypes parsedReportType = Reporting.Rendering.ReportTypes.Html;
                    this.reportTypeValid &= Enum.TryParse <ReportTypes>(reportType, true, out parsedReportType);
                    this.ReportType      |= parsedReportType;
                }
            }
            else
            {
                this.ReportType = ReportTypes.Html;
            }

            this.SourceDirectories = sourceDirectories;
            this.Filters           = filters;

            if (verbosityLevel != null)
            {
                VerbosityLevel parsedVerbosityLevel = VerbosityLevel.Verbose;
                this.verbosityLevelValid = Enum.TryParse <VerbosityLevel>(verbosityLevel, true, out parsedVerbosityLevel);
                this.VerbosityLevel      = parsedVerbosityLevel;
            }
        }
Пример #17
0
 public ApplicationSettingsBase this[ReportTypes type]
 {
     get
     {
         return(_configs[type]);
     }
 }
        public static String GetGeneratedReportId(CxRestContext ctx, CancellationToken token,
                                                  String scanId, ReportTypes type)
        {
            var dict = new Dictionary <String, String>()
            {
                { "reportType", type.ToString() },
                { "scanId", scanId }
            };

            return(WebOperation.ExecutePost <String>(
                       ctx.Json.CreateSastClient
                       , (response) =>
            {
                using (var sr = new StreamReader(response.Content.ReadAsStreamAsync().Result))
                    using (var jtr = new JsonTextReader(sr))
                    {
                        JToken jt = JToken.Load(jtr);
                        return ReadReportId(jt);
                    }
            }
                       , CxRestContext.MakeUrl(ctx.Url, URL_SUFFIX)
                       , () => new FormUrlEncodedContent(dict)
                       , ctx
                       , token));
        }
Пример #19
0
        public ReportResult CreateReportResultForPeriod(int periodId, ReportTypes reportType, ReportContext reportContext)
        {
            Report report = reportContext.Reports.Single(r => r.PeriodId == periodId &&
                                                              r.ReportType == reportType &&
                                                              r.Level == this.Class.Level);

            return report.CreateReportResult(periodId, this.Id, reportContext);
        }
Пример #20
0
        //public static int SystemSettingDrawingOrRaffle {get;set;}
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the GetReportListExMessage class.
        /// </summary>
        /// <param name="type">The type of reports to retrieve.</param>
        /// <param name="localeId">The LCID of the culture to use.</param>
        public GetReportListExMessage(ReportTypes type, int localeId)
        {
            m_id             = 18129;
            m_strMessageName = "Get Report List Ex";
            m_typeId         = (int)type;
            m_localeId       = localeId;
            m_reports        = new Dictionary <int, ReportInfo>();
        }
 public void Dispose()
 {
     ReportTypes.ForEach((thislist, thisreport) => RemoveWeakEventListener(thisreport, ReportListener));
     if (CurrentGroupItem != null)
     {
         RemoveWeakEventListener(CurrentGroupItem, EncryptListener);
     }
 }
Пример #22
0
        /// <summary>
        /// Gets the byte array for given local report.
        /// </summary>
        /// <param name="localReport">The local report.</param>
        /// <param name="exportType">Type of the export.</param>
        /// <param name="isLandscape">if set to <c>true</c> [is landscape].</param>
        /// <param name="fileNameExtension">The file name extension.</param>
        /// <param name="encoding">The encoding.</param>
        /// <param name="mimeType">Type of the MIME.</param>
        /// <returns></returns>
        internal static byte[] GetByteArrayByLocalReport(LocalReport localReport, ReportTypes exportType, bool isLandscape, out string fileNameExtension, out string encoding, out string mimeType)
        {
            string reportType = string.Empty;
            string deviceInfo = null;

            Warning[] warnings;
            string[]  streams;

            switch (exportType)
            {
            case ReportTypes.Pdf:     //Report properties are overridden by deviceinfo, this must be done.
                if (isLandscape)
                {
                    deviceInfo =
                        "<DeviceInfo>" +
                        "  <OutputFormat>PDF</OutputFormat>" +
                        "  <PageWidth>11in</PageWidth>" +
                        "  <PageHeight>8.5in</PageHeight>" +
                        "  <MarginTop>0.5in</MarginTop>" +
                        "  <MarginLeft>0.5in</MarginLeft>" +
                        "  <MarginRight>0.5in</MarginRight>" +
                        "  <MarginBottom>0.5in</MarginBottom>" +
                        "</DeviceInfo>";
                }
                else
                {
                    deviceInfo =
                        "<DeviceInfo>" +
                        "  <OutputFormat>PDF</OutputFormat>" +
                        "  <PageWidth>8.5in</PageWidth>" +
                        "  <PageHeight>11in</PageHeight>" +
                        "  <MarginTop>0.5in</MarginTop>" +
                        "  <MarginLeft>0.5in</MarginLeft>" +
                        "  <MarginRight>0.5in</MarginRight>" +
                        "  <MarginBottom>0.5in</MarginBottom>" +
                        "</DeviceInfo>";
                }

                reportType = "PDF";
                break;

            case ReportTypes.Excel:
                reportType = "Excel";
                break;

            default:
                break;
            }

            return(localReport.Render(
                       reportType,
                       deviceInfo,
                       out mimeType,
                       out encoding,
                       out fileNameExtension,
                       out streams,
                       out warnings));
        }
Пример #23
0
        public virtual void ReadXml(XmlReader r)
        {
            r.MoveToContent();
            string   reportDate = r.GetAttribute(0);
            DateTime reportDateTest;

            if (DateTime.TryParse(reportDate, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out reportDateTest))
            {
                _dateReport = reportDateTest;
            }
            _dateCopied = Convert.ToDateTime(r.GetAttribute(1), System.Globalization.CultureInfo.InvariantCulture);

            r.Read();
            _reportType   = (ReportTypes)Convert.ToInt32(r.ReadElementString("Type"));
            _reportStatus = (ReportStatusses)Convert.ToInt32(r.ReadElementString("Status"));
            _reportFlag   = (ReportFlags)Convert.ToInt32(r.ReadElementString("Flags"));

            r.MoveToContent();
            _loyaltyBegin = Convert.ToInt32(r.GetAttribute(0));
            _loyaltyEnd   = Convert.ToInt32(r.GetAttribute(1));
            r.Read();
            r.MoveToContent();

            _attacker = new ReportVillage();
            _attacker.ReadXml(r);
            //r.ReadEndElement();
            //r.MoveToContent();

            _defender = new ReportVillage();
            _defender.ReadXml(r);
            //r.Read();
            //r.MoveToContent();
            //r.ReadStartElement();
            //r.MoveToContent();

            _resourcesHaul = new Resource();
            r.Read();
            _resourcesHaul.ReadXml(r);
            //r.ReadEndElement();
            _resourceHaulMax = Convert.ToInt32(r.ReadElementString("Max"));
            r.Read();
            r.Read();

            _resourcesLeft = new Resource();
            _resourcesLeft.ReadXml(r);
            r.Read();

            DateTime?tempDate;

            _attack = ReportUnit.LoadXmlList(r, out tempDate);

            _defense = ReportUnit.LoadXmlList(r, out tempDate);

            _buildings = ReportBuilding.LoadXmlList(r, out tempDate);

            r.ReadEndElement();
            r.Read();
        }
Пример #24
0
 public void Gen(ReportTypes RT)
 {
     switch (RT)
     {
     case ReportTypes.TechPassport:
         break;
     }
     ;
 }
Пример #25
0
 /// <summary>
 /// Reports (submits a complaint about) a video.
 /// </summary>
 /// <param name="videoId">Video ID.</param>
 /// <param name="ownerId">ID of the user or community that owns the video(s).</param>
 /// <param name="reason">Reason for the complaint.</param>
 /// <param name="comment">Comment describing the complaint.</param>
 /// <param name="searchQuery">(If the video was found in search results.) Search query string.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task <Response <bool> > Report(int videoId, int ownerId, ReportTypes reason, string comment = null,
                                             string searchQuery = null) => await Request <bool>("report", new MethodParams
 {
     { "video_id", videoId, true },
     { "owner_id", ownerId, true },
     { "reason", (int)reason },
     { "comment", comment },
     { "search_query", searchQuery }
 });
Пример #26
0
 public ReportViewerCommon(ReportDocument report, ReportTypes reportType, EmailDTO emailDetail)
 {
     InitializeComponent();
     //reportDoc = report;
     Messenger.Default.Send <ReportDocument>(report);
     Messenger.Default.Send <ReportTypes>(reportType);
     Messenger.Default.Send <EmailDTO>(emailDetail);
     Messenger.Reset();
 }
Пример #27
0
 public ReportConfiguration(string code, string alias, string className, string reportFilePath, ReportTypes reportType, string datasetFile)
 {
     mCode           = code;
     mAlias          = alias;
     mClassName      = className;
     mReportFilePath = reportFilePath;
     mReportType     = reportType;
     mDatasetFile    = datasetFile;
 }
        private void ValidateResultNotWritten(string path, ReportTypes ReportType)
        {
            string text = File.ReadAllText(path);

            foreach (string resultType in ReportType.ToString().Split(','))
            {
                Assert.IsFalse(text.Contains($"{resultType}: "), $"Expected to not find '{resultType}: '");
            }
        }
Пример #29
0
 private DeviceInfoXML(ReportTypes type, double pageWidth, double pageHeight)
 {
     Type         = type;
     PageWidth    = pageWidth;
     PageHeight   = pageHeight;
     MarginTop    = 0;
     MarginLeft   = 0;
     MarginRight  = 0;
     MarginBottom = 0;
 }
Пример #30
0
 /// <summary>
 /// Writes the file header.
 /// </summary>
 public override void WriteHeader(ReportTypes reportType, int numberOfRows = 0)
 {
     if (reportType == ReportTypes.CollectionsReport)
     {
         _file.WriteLine(GetCollectionReportHeader());
     }
     else
     {
         _file.WriteLine(GetMovementReportHeader());
     }
 }
Пример #31
0
 public object GetReportData(ReportTypes reportType, List <KeyValuePair <string, string> > paramsCollection)
 {
     if (reportType == ReportTypes.ActiveGuestList)
     {
         return(GetActiveGuestList(paramsCollection));
     }
     else
     {
         return(null);
     }
 }
Пример #32
0
        public static void UpdateReportLogStatus(long rptlogId, ReportTypes reportType, ReportStage reportStage, bool complete)
        {
            var cmd = _db.GetStoredProcCommand("[dbo].[uspReportLog_StatusUpdate]");

            _db.AddInParameter(cmd, "rptlogId", SqlDbType.BigInt, rptlogId);
            _db.AddInParameter(cmd, "reportType", SqlDbType.VarChar, reportType.ToString());
            _db.AddInParameter(cmd, "reportStage", SqlDbType.VarChar, reportStage.ToString());
            _db.AddInParameter(cmd, "complete", SqlDbType.Bit, complete);

            _db.ExecuteNonQuery(cmd);
        }
Пример #33
0
 public static List<TestGroup> CreateTestGroups(ReportTypes reportType, ReportContext reportContext)
 {
     switch (reportType)
     {
         case ReportTypes.Swim:
             return CreateTestGroupsForSwim(reportContext);
         case ReportTypes.Gym:
             return CreateTestGroupsForGym(reportContext);
         default:
             return new List<TestGroup>();
     }
 }
Пример #34
0
 public int GetNumberForReportType(ReportTypes reportType)
 {
     switch (reportType)
     {
         case ReportTypes.Swim:
             return this.NumberSwim;
         case ReportTypes.Gym:
             return this.NumberGym;
         default:
             return 0;
     }
 }
Пример #35
0
        public static Report CreateReport(int level, ReportTypes reportType, int currentPeriodId, ReportContext reportContext)
        {
            Report report = reportContext.Reports.Create();

            report.Level = level;
            report.ReportType = reportType;
            report.PeriodId = currentPeriodId;
            report.Period = reportContext.Periods.Find(currentPeriodId);
            report.TestGroups = TestGroup.CreateTestGroups(reportType, reportContext);

            return report;
        }
        public ActionResult Create(int level, ReportTypes reportType, int currentPeriodId)
        {
            Report existingReport = db.Reports.SingleOrDefault(r => r.Level == level &&
                                                                    r.ReportType == reportType &&
                                                                    r.PeriodId == currentPeriodId);
            if (existingReport != null)
            {
                throw new InvalidOperationException("Dit leerjaar heeft al een rapport voor deze periode!");
            }

            Report report = Report.CreateReport(level, reportType, currentPeriodId, this.db);

            return this.RedirectToLoginIfNotAuthenticated(View(report));
        }
Пример #37
0
        public ActionResult Create(int studentInClassId = 0, ReportTypes reportType = 0, int currentPeriodId = 1)
        {
            StudentInClass currentStudent = DB.StudentInClasses.Single(s => s.Id == studentInClassId);
            if (currentStudent.HasReportResultForPeriod(currentPeriodId, reportType, this.CurrentUser))
            {
                throw new InvalidOperationException("Deze leerling heeft al een rapport voor deze periode!");
            }

            ViewBag.CurrentStudent = currentStudent;
            ViewBag.CurrentPeriod = DB.Periods.Single(p => p.Id == currentPeriodId);

            ReportResult reportResult = currentStudent.CreateReportResultForPeriod(currentPeriodId, reportType, this.CurrentUser, this.DB);

            return this.RedirectToLoginIfNotAuthenticated(View(reportResult));
        }
        public static ReportDataSource GetDataSource(ReportTypes report, Dictionary<string, object> parameters)
        {
            switch (report)
            {
                case ReportTypes.SELECTED_YEAR_NONPAYERS:
                    return new ReportDataSource("DataSet1", SelectedYearNonPayersDataSet(parameters));
                case ReportTypes.REGULAR_NONPAYERS:
                    return new ReportDataSource("DataSet1", RegularNonPayersDataSet(parameters));
                case ReportTypes.SELECTED_YEAR_STATISTICS:
                    return new ReportDataSource("DataSet1", SelectedYearStatisticsDataSet(parameters));
                default:
                    break;
            }

            return new ReportDataSource("DataSet1");
        }
Пример #39
0
        public SelectList GetPossibleRemarks(ReportTypes reportType)
        {
            if (reportType == ReportTypes.Swim)
            {
                return new SelectList(new[]
                {
                    "",
                    "We raden aan om buiten de schooluren regelmatig te gaan zwemmen. Eventueel enkele extra zwemlessen overwegen?",
                    "Je bent op goede weg, nog een beetje oefenen en je wordt een echte zwemkampioen!",
                    "Schitterend, doe zo voort!",
                    "Dit lukt je nog niet, we raden sterk aan om buiten de schooluren regelmatig te gaan zwemmen! Eventueel enkele extra zwemlessen overwegen?"
                });
            }

            return new SelectList(new[]
            {
                "",
                "Dit lukt je nog niet!",
                "Extra oefenen!",
                "Je bent op goede weg, blijven oefenen!",
                "Schitterend, doe zo voort!"
            });
        }
Пример #40
0
 /// <summary>
 /// Reports (submits a complain about) a user. 
 /// </summary>
 /// <param name="userId">ID of the user about whom a complaint is being made</param>
 /// <param name="type">Type of complaint.</param>
 /// <param name="comment">Comment describing the complaint.</param>
 /// <returns>When executed successfully it returns True.</returns>
 public async Task<Response<bool>> Report(int userId, ReportTypes type, string comment = "")
     => await Request<bool>("report", new MethodParams
     {
         {"user_id", userId, true, UserIdsRange},
         {"type", type},
         {"comment", comment}
     });
Пример #41
0
        public ActionResult Print(ReportTypes reportType = 0, int currentPeriodId = 1, int currentYear = 2012, int currentClassId = 0, string location = null)
        {
            ViewBag.CurrentPeriod = DB.Periods.Find(currentPeriodId);
            ViewBag.ReportType = reportType;

            var studentInClasses = DB.StudentInClasses.Where(s => s.Year == currentYear)
                .Include(s => s.Student)
                .Include(s => s.ReportResults)
                .Include(s => s.Class).ToList()
                .Where(s => s.HasReportResultForPeriod(currentPeriodId, reportType, this.CurrentUser));

            if (currentClassId != 0)
            {
                studentInClasses = studentInClasses.Where(s => s.ClassId == currentClassId);
            }

            if (!string.IsNullOrWhiteSpace(location))
            {
                studentInClasses = studentInClasses.Where(s => s.Class.Location.Equals(location, StringComparison.OrdinalIgnoreCase));
            }

            studentInClasses = studentInClasses.OrderBy(s => s.Class.Location)
                                               .ThenBy(s => s.Class.Level)
                                               .ThenBy(s => s.DisplayName);

            return this.RedirectToLoginIfNotAuthenticated(View(studentInClasses));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RendererFactory"/> class.
 /// </summary>
 /// <param name="reportType">Type of the report.</param>
 public RendererFactory(ReportTypes reportType)
 {
     this.reportType = reportType;
 }
Пример #43
0
 public ReportConfiguration(string code, string alias, string className, string reportFilePath, ReportTypes reportType, string datasetFile)
 {
     mCode = code;
     mAlias = alias;
     mClassName = className;
     mReportFilePath = reportFilePath;
     mReportType = reportType;
     mDatasetFile = datasetFile;
 }
Пример #44
0
 /// <summary>
 /// Reports (submits a complaint about) a video.
 /// </summary>
 /// <param name="videoId">Video ID.</param>
 /// <param name="ownerId">ID of the user or community that owns the video(s).</param>
 /// <param name="reason">Reason for the complaint.</param>
 /// <param name="comment">Comment describing the complaint.</param>
 /// <param name="searchQuery">(If the video was found in search results.) Search query string.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task<Response<bool>> Report(int videoId, int ownerId, ReportTypes reason, string comment = null,
     string searchQuery = null) => await Request<bool>("report", new MethodParams
     {
         {"video_id", videoId, true},
         {"owner_id", ownerId, true},
         {"reason", (int) reason},
         {"comment", comment},
         {"search_query", searchQuery}
     });
        protected List<Models.PhoneLog> getAllLogsByType(ReportTypes.types typeVal)
        {
            List<Models.PhoneLog> logs;
            switch (typeVal)
            {
                case ReportTypes.types.allLogs:
                    logs = PhoneLogController.getAllPhoneLogs();
                    break;
                case ReportTypes.types.thirtyDays:
                    logs = PhoneLogController.getAllPhoneLogsInRange(DateTime.Now.Subtract(new TimeSpan(30, 0, 0, 0)), DateTime.Now);
                    break;
                case ReportTypes.types.notFollowedUp:
                    logs = PhoneLogController.getAllPhoneLogsNotFollowedUp();
                    break;
                default:
                    logs = PhoneLogController.getAllPhoneLogs();
                    break;
            }

            return logs;
        }
Пример #46
0
 /// <summary>
 /// Reports (submits a complaint about) a comment on a video.
 /// </summary>
 /// <param name="commentId">ID of the comment being reported.</param>
 /// <param name="ownerId">ID of the user or community that owns the video. </param>
 /// <param name="reason">Reason for the complaint.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task<Response<bool>> ReportComment(int commentId, int ownerId, ReportTypes reason)
     => await Request<bool>("reportComment", new MethodParams
     {
         {"comment_id", commentId, true},
         {"owner_id", ownerId},
         {"reason", (int) reason}
     });
Пример #47
0
		///  <summary>
		///  Displays received or written report data.
		///  </summary>
		///  
		///  <param name="buffer"> contains the report data. </param>			
		///  <param name="currentReportType" > "Input", "Output", or "Feature"</param>
		///  <param name="currentReadOrWritten" > "read" for Input and IN Feature reports, "written" for Output and OUT Feature reports.</param>

		private void DisplayReportData(Byte[] buffer, ReportTypes currentReportType, ReportReadOrWritten currentReadOrWritten)
		{
			try
			{
				Int32 count;

				LstResults.Items.Add(currentReportType.ToString() + " report has been " + currentReadOrWritten.ToString().ToLower() + ".");

				//  Display the report data received in the form's list box.

				LstResults.Items.Add(" Report ID: " + String.Format("{0:X2} ", buffer[0]));
				LstResults.Items.Add(" Report Data:");

				TxtBytesReceived.Text = "";

				for (count = 1; count <= buffer.Length - 1; count++)
				{
					//  Display bytes as 2-character Hex strings.

					String byteValue = String.Format("{0:X2} ", buffer[count]);

					LstResults.Items.Add(" " + byteValue);

					//  Display the received bytes in the text box.

					TxtBytesReceived.SelectionStart = TxtBytesReceived.Text.Length;
					TxtBytesReceived.SelectedText = byteValue + Environment.NewLine;
				}
				ScrollToBottomOfListBox();
			}
			catch (Exception ex)
			{
				DisplayException(Name, ex);
				throw;
			}
		}
Пример #48
0
		/// <summary>
		/// Start doing periodic transfers.
		/// </summary>

		private void PeriodicTransfersStart()
		{
			// Don't allow changing the transfer type while transfers are in progress.

			if (radFeature.Checked)
			{
				radInputOutputControl.Enabled = false;
				radInputOutputInterrupt.Enabled = false;
			}
			else if (radInputOutputControl.Checked)
			{
				radFeature.Enabled = false;
				radInputOutputInterrupt.Enabled = false;
			}
			else if (radInputOutputInterrupt.Checked)
			{
				radFeature.Enabled = false;
				radInputOutputControl.Enabled = false;
			}

			//  Change the command button's text.

			cmdPeriodicTransfers.Text = "Stop";

			//  Enable the timer event to trigger a set of transfers.

			_periodicTransfers.Start();

			cmdPeriodicTransfers.Enabled = true;

			if (radInputOutputInterrupt.Checked)
			{
				_transferType = TransferTypes.Interrupt;
				_reportType = ReportTypes.Output;
			}
			else if (radInputOutputControl.Checked)
			{
				_transferType = TransferTypes.Control;
				_reportType = ReportTypes.Output;
			}
			else if (radFeature.Checked)
			{
				_transferType = TransferTypes.Control;
				_reportType = ReportTypes.Feature;
			}
			_periodicTransfersRequested = true;
			PeriodicTransfers();
		}
Пример #49
0
 /// <summary>
 /// Writes the file header.
 /// </summary>
 public override void WriteHeader(ReportTypes reportType, int numberOfRows = 0)
 {
     if (reportType == ReportTypes.CollectionsReport)
     {
         _file.WriteLine(GetCollectionReportHeader());
     }
     else
     {
         _file.WriteLine(GetMovementReportHeader());
     }
 }
 public ReportTypeListItem(ReportTypes reportType)
 {
     ReportType = reportType;
     Displayname = reportType.GetDescription();
 }
Пример #51
0
        public bool HasReportResultForPeriod(int periodId, ReportTypes reportType)
        {
            if (reportType == ReportTypes.Swim)
            {
                return this.HasReportResultForPeriod(this.SwimReportResults, periodId);
            }

            return this.HasReportResultForPeriod(this.GymReportResults, periodId);
        }
Пример #52
0
        public ActionResult Print(ReportTypes reportType = 0, int currentPeriodId = 1, int currentYear = 2012, int currentClassId = 0)
        {
            ViewBag.CurrentPeriod = db.Periods.Find(currentPeriodId);
            ViewBag.ReportType = reportType;

            var studentInClasses = db.StudentInClasses.Where(s => s.Year == currentYear)
                .Include(s => s.Student)
                .Include(s => s.ReportResults)
                .Include(s => s.Class).ToList()
                .Where(s => s.HasReportResultForPeriod(currentPeriodId, reportType));

            if (currentClassId != 0)
            {
                studentInClasses = studentInClasses.Where(s => s.ClassId == currentClassId);
            }

            studentInClasses = studentInClasses.OrderBy(s => s.DisplayName);

            return this.RedirectToLoginIfNotAuthenticated(View(studentInClasses));
        }
Пример #53
0
 /// <summary>
 /// Sends a complaint to the item.
 /// </summary>
 /// <param name="ownerId">Identifier of an item owner community.</param>
 /// <param name="itemId">Item Id.</param>
 /// <param name="reason">Complaint reason.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task<Response<bool>> Report(int ownerId, int itemId, ReportTypes reason)
     => await Request<bool>("report", new MethodParams
     {
         {"owner_id", ownerId, true},
         {"item_id", itemId, true},
         {"reason", (int) reason, true}
     });
        /// <summary>
        /// Returns a health report
        /// </summary>
        /// <param name="context">The service fabric context that the health report is for</param>
        /// <param name="reportSourceId">The unique reporting source id</param>
        /// <param name="propertyName">The name of the health property being reported on</param>
        /// <param name="state">The current state of the health property</param>
        /// <param name="timeToLive">The time to live of the health report</param>
        /// <param name="reportType">The entity type the report is for</param>
        /// <returns>A health report for the appropriate reporting entity</returns>
        public static HealthReport GetHealthReport(ServiceContext context, string reportSourceId, string propertyName, HealthState state, ReportTypes reportType, TimeSpan timeToLive)
        {
            HealthReport report;
            var information = new HealthInformation(reportSourceId, propertyName, state);

            information.Description = $"{ propertyName } health state { Enum.GetName(typeof(HealthState), state) }";
            information.RemoveWhenExpired = true;
            information.TimeToLive = timeToLive;
            information.SequenceNumber = HealthInformation.AutoSequenceNumber;

            switch (reportType)
            {
                case ReportTypes.Cluster:
                    report = new ClusterHealthReport(information);
                    break;

                case ReportTypes.Application:
                    report = new ApplicationHealthReport(new Uri(context.CodePackageActivationContext.ApplicationName), information);
                    break;

                case ReportTypes.DeployedApplication:
                    report = new DeployedApplicationHealthReport(new Uri(context.CodePackageActivationContext.ApplicationName), context.NodeContext.NodeName, information);
                    break;

                case ReportTypes.Service:
                    report = new ServiceHealthReport(context.ServiceName, information);
                    break;

                case ReportTypes.DeployedService:
                    report = new DeployedServicePackageHealthReport(new Uri(context.CodePackageActivationContext.ApplicationName), context.CodePackageActivationContext.GetServiceManifestName(), context.NodeContext.NodeName, information);
                    break;

                case ReportTypes.Node:
                    report = new NodeHealthReport(context.NodeContext.NodeName, information);
                    break;

                case ReportTypes.Instance:
                    if (context is StatelessServiceContext)
                    {
                        report = new StatelessServiceInstanceHealthReport(context.PartitionId, context.ReplicaOrInstanceId, information);
                    }
                    else
                    {
                        report = new StatefulServiceReplicaHealthReport(context.PartitionId, context.ReplicaOrInstanceId, information);
                    }
                    break;

                default:
                    throw new ArgumentException("Unknown health type", nameof(reportType));
            }

            return report;
        }
        /// <summary>
        /// Initializes a new instance of the reporting type and 
        /// </summary>
        /// <param name="traceId">A unique identifier used to correlate the debugging and diagnostics messages</param>
        /// <param name="logger">An instance used to write debugging and diagnostics information</param>
        /// <param name="componentName">The name of the component for debugging and diagnostics messages</param>
        /// <param name="reportSourceId">A unique id used to represent the source of the health report</param>
        /// <param name="reportCallback">A method to be called when the health data is required</param>
        /// <param name="context">The service fabric context that is assocaited with the entity being reported on</param>
        /// <param name="reportType">The entity type the health report is for</param>
        /// <param name="reportingInterval">How often the report will be sent</param>
        /// <param name="batchInterval">The amount of time to delay before sending for batching purposes, 0 for immediate</param>
        /// <param name="timeout">The timeout for sending a report</param>
        /// <param name="retryInterval">The amount of time to wait before trying to resend a report</param>
        public HealthReporter(Guid traceId, ILogger logger, string componentName, string reportSourceId, ReportGenerator reportCallback, ServiceContext context, ReportTypes reportType, TimeSpan? reportingInterval = null, TimeSpan? batchInterval = null, TimeSpan? timeout = null, TimeSpan? retryInterval = null)
        {
            if (string.IsNullOrEmpty(reportSourceId)) throw new ArgumentException("Parameter cannot be null or empty.", nameof(reportSourceId));
            if (reportCallback == null) throw new ArgumentNullException(nameof(reportCallback));

            this.logger = logger;
            this.componentName = componentName;
            this.logger.Informational(traceId, this.componentName, "Instantiated health reporter");


            this.reportSourceId = reportSourceId;
            this.reportType = reportType;
            this.reportCallback = reportCallback;

            this.client = new FabricClient(new FabricClientSettings
            {
                HealthReportRetrySendInterval = retryInterval ?? TimeSpan.FromSeconds(40),
                HealthReportSendInterval = batchInterval ?? TimeSpan.FromSeconds(0),
                HealthOperationTimeout = timeout ?? TimeSpan.FromSeconds(120)
            });
            
            this.context = context;

            this.interval = reportingInterval ?? TimeSpan.FromSeconds(30);
            if (this.interval < TimeSpan.FromSeconds(5)) this.interval = TimeSpan.FromSeconds(15);

            this.timeToLive = TimeSpan.FromSeconds((this.interval.TotalSeconds * 2.0) + 1.0);
        }
Пример #56
0
 public void createReport(ReportTypes type)
 {
     Set<string> loci = new Set<string>();
     if (type == ReportTypes.EXPORT_ALL_PEPTIDES || type == ReportTypes.EXPORT_ALL_PROTEINS)
     {
         foreach (DataGridViewRow row in proteinGrid.Rows)
         {
             string locus = proteinGrid["Locus", row.Index].Value.ToString();
             if (locus != null && locus.Length > 0)
                 loci.Add(locus);
         }
     }
     else if (type == ReportTypes.EXPORT_SELECTED_PEPTIDE || type == ReportTypes.EXPORT_SELECTED_PROTEIN)
     {
         int selectedRowCount = proteinGrid.Rows.GetRowCount(DataGridViewElementStates.Selected);
         if (selectedRowCount > 0)
         {
             // Find the protein locus
             int rowIndex = Int32.Parse(proteinGrid.CurrentRow.Index.ToString());
             string locus = proteinGrid["Locus", rowIndex].Value.ToString();
             if (locus != null && locus.Length > 0)
                 loci.Add(locus);
         }
     }
     if (loci.Count > 0)
     {
         // Get the file to save
         SaveFileDialog outputFile = new SaveFileDialog();
         outputFile.Filter = "CSV|*.csv";
         outputFile.Title = "Export the results...";
         outputFile.ShowDialog();
         if (outputFile.FileName.Length == 0)
             return;
         StreamWriter writer = new StreamWriter(outputFile.OpenFile());
         if (type == ReportTypes.EXPORT_ALL_PROTEINS || type == ReportTypes.EXPORT_SELECTED_PROTEIN)
             exportProteinReport(loci, writer);
         else if (type == ReportTypes.EXPORT_ALL_PEPTIDES || type == ReportTypes.EXPORT_SELECTED_PEPTIDE)
             exportPeptideReport(loci, writer);
         writer.Close();
     }
 }
Пример #57
0
        ReportTypes ReportType; // тип отчета

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Инициализация окна
        /// </summary>
        /// <param name="type">Тип отчета</param>
        public FCreateReport(ReportTypes type)
        {
            InitializeComponent();
            ReportType = type;
            InitWindow();
        }