Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        public static string[] BuildPortfolioResult(WSConnection connection, Application[] application)
        {
            //Build Quality Indicators
            using (PortfolioBLL applicationBLL = new PortfolioBLL(connection, application))
            {
                List<string> Apps_SetSnapshots = applicationBLL.SetSnapshots();
                List<string> Apps_SetQualityIndicators = applicationBLL.SetQualityIndicators();
                List<string> Apps_SetSizingMeasure = applicationBLL.SetSizingMeasure();

                string[] AppsToIgnore = Apps_SetQualityIndicators.Concat(Apps_SetSnapshots).Concat(Apps_SetSizingMeasure).ToArray();
                return AppsToIgnore;
                //Task taskSetSnapshots = new Task(() => applicationBLL.SetSnapshots());
                //taskSetSnapshots.Start();

                //Task taskQualityIndicators = new Task(() => applicationBLL.SetQualityIndicators());
                //taskQualityIndicators.Start();

                ////Build Quality Indicators
                //Task taskSizingMeasure = new Task(() => applicationBLL.SetSizingMeasure());
                //taskSizingMeasure.Start();

                //taskSetSnapshots.Wait();
                //taskQualityIndicators.Wait();
                //taskSizingMeasure.Wait();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        public static void BuildApplicationResult(WSConnection connection, Application application)
        {
            //Build Quality Indicators
            using (ApplicationBLL applicationBLL = new ApplicationBLL(connection, application))
            {
                Task taskQualityIndicators = new Task(() => applicationBLL.SetQualityIndicators());
                taskQualityIndicators.Start();

                //Build Quality Indicators
                Task taskSizingMeasure = new Task(() => applicationBLL.SetSizingMeasure());
                taskSizingMeasure.Start();

                taskQualityIndicators.Wait();
                taskSizingMeasure.Wait();
            }
        }
Ejemplo n.º 3
0
        //public List<string> GetCommonTaggedApplications()
        //{
        //    List<string> CommonTaggedApplications = new List<string>();
        //    using (var castRepository = GetRepository())
        //    {
        //        string strCommonTagsJson = castRepository.GetCommonTagsJson();
        //        if (strCommonTagsJson != null)
        //        {
        //        }
        //    }
        //    return CommonTaggedApplications;
        //}
        public List<Snapshot> GetAllSnapshots(Application[] Applications)
        {
            List<Snapshot> Snapshots = new List<Snapshot>();
            using (var castRepository = GetRepository())
            {
                for (int j = 0; j < Applications.Count(); j++)
                {
                    Application Appl = Applications[j];

                    int nbSnapshotsEachApp = Appl.Snapshots.Count();
                    if (nbSnapshotsEachApp > 0)
                    {
                        foreach (Snapshot snapshot in Appl.Snapshots.OrderBy(_ => _.Annotation.Date.DateSnapShot))
                        {
                            Snapshots.Add(snapshot);
                        }
                    }
                }
            }
            return Snapshots;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="CurrentSnapshot"></param>
        /// <param name="PreviousSnapshot"></param>
        /// <param name="application"></param>
        /// <param name="indicatorId"></param>
        /// <returns></returns>
        public static Double? SumDeltaIndicator(Snapshot CurrentSnapshot, Snapshot PreviousSnapshot, Application application, Constants.SizingInformations measureId)
        {
            double? result = null;
            if(application != null && CurrentSnapshot != null && CurrentSnapshot.SizingMeasuresResults != null)
            {
                result = GetSizingMeasure(CurrentSnapshot, measureId);

                if (PreviousSnapshot != null && PreviousSnapshot.Annotation.Date.DateSnapShot.HasValue && PreviousSnapshot.SizingMeasuresResults != null )
                {
                    DateTime dtPrevoiusSnapshot = PreviousSnapshot.Annotation.Date.DateSnapShot.Value;
                    DateTime dtCurrentSnapshot = CurrentSnapshot.Annotation.Date.DateSnapShot.Value;

                    var quryPreviusIndicators = from s in application.Snapshots
                                                where s.Annotation.Date.DateSnapShot > dtPrevoiusSnapshot
                                                &&    s.Annotation.Date.DateSnapShot < dtCurrentSnapshot
                                                from i in s.SizingMeasuresResults
                                                where i.Reference.Key == measureId.GetHashCode()
                                                select i;

                    result += quryPreviusIndicators.Sum(s => s.DetailResult.Value);
                }
            }
            return result;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="currentSnapshot"></param>
 /// <param name="previousSnapshot"></param>
 public PortfolioBLL(WSConnection connection, Application[] application)
     : base(connection)
 {
     _Application = application;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="connection"></param>
 /// <param name="application"></param>
 /// <returns></returns>
 private static void SetSnapshots(WSConnection connection, Application application)
 {
     using (ApplicationBLL applicationBLL = new ApplicationBLL(connection, application))
     {
         applicationBLL.SetSnapshots();
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="currentSnapshot"></param>
 /// <param name="previousSnapshot"></param>
 public ApplicationBLL(WSConnection connection, Application application)
     : base(connection)
 {
     _Application = application;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 
        /// </summary>
        private void GenerateReportPortfolio(Application[] Applications, Snapshot[] ApplicationsSnapshots, string[] IgnoredApps, string[] IgnoredSnapshots )
        {
            string tmpReportFile = String.Empty;
            string tmpReportFileFlexi = String.Empty;

            try
            {

                //Create temporary report
                string workDirectory = SettingsBLL.GetApplicationPath();
                tmpReportFile = PathUtil.CreateTempCopy(workDirectory, SelectedTemplateFile.FullName);
                if (tmpReportFile.Contains(".xlsx"))
                {
                    tmpReportFileFlexi = PathUtil.CreateTempCopyFlexi(workDirectory, SelectedTemplateFile.FullName);
                }
                //Build report
                ReportData reportData = new ReportData()
                {
                    FileName = tmpReportFile,
                    Application = null,
                    CurrentSnapshot = null,
                    PreviousSnapshot = null,
                    Parameter = Setting.ReportingParameter,
                    RuleExplorer = new RuleBLL(ActiveConnection),
                    SnapshotExplorer = new SnapshotBLL(ActiveConnection, SelectedSnapshot),
                    CurrencySymbol = "$",
                    Applications = Applications,
                    Category = SelectedCategory,
                    Tag = SelectedTag,
                    snapshots = ApplicationsSnapshots,
                    IgnoresApplications = IgnoredApps,
                    IgnoresSnapshots = IgnoredSnapshots
                };

                using (IDocumentBuilder docBuilder = BuilderFactory.CreateBuilder(reportData, tmpReportFileFlexi))
                {
                    docBuilder.BuildDocument();
                }

                if (tmpReportFile.Contains(".xlsx"))
                {
                    tmpReportFile = tmpReportFileFlexi;
                }

                //Copy report file to the selected destination
                File.Copy(tmpReportFile, ReportFileName, true);
            }
            catch (Exception ex)
            {
                ReportFileName = String.Empty;

                throw (ex);
            }
            finally
            {
                if (!String.IsNullOrEmpty(tmpReportFile)) File.Delete(tmpReportFile);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Implement Command that Load the templates list
        /// </summary>
        void ExecuteReloadTemplatesCommand(object parameter)
        {
            //if (_SelectedTag != null && _SelectedTemplateFile != null)
            //{
            //    return true;
            //}
            //else
            //{
            //    return _SelectedApplication != null &&
            //           _SelectedSnapshot != null &&
            //           _SelectedTemplateFile != null;
            //}
            if (SelectedTab == 0)
            {
                SelectedCategory = null;
                _SelectedCategory = null;
                _SelectedTemplateFile = null;
                SelectedTemplateFile = null;
                TemplateFiles = SettingsBLL.GetTemplateFileList();
            }
            else
                if (SelectedTab == 1)
                {
                    SelectedApplication = null;
                    SelectedSnapshot = null;
                    _SelectedApplication = null;
                    _SelectedSnapshot = null;

                    TemplateFiles = SettingsBLL.GetTemplateFileListPortfolio();
                }
        }
Ejemplo n.º 10
0
 public ApplicationItem(Application app)
 {
     Application = app;
 }