Exemplo n.º 1
0
        public List <Entry> GenerateChartActivitiesImputedGroupByTaskAndProject(Models.Timesheet timesheet)
        {
            var projectsGroup = timesheet.Activities.GroupBy(x => new { x.Value.ProjectId, x.Value.TaskId });
            var entries       = new List <Microcharts.Entry>();
            var indexColor    = 0;

            foreach (var item in projectsGroup)
            {
                var tempProject = timesheet.Projects.FirstOrDefault(x => x.Value.Id.Equals(item.Key.ProjectId));
                var tempTask    = tempProject.Value?.Tasks.FirstOrDefault(x => x.Value.Id.Equals(item.Key.TaskId));

                var imputed = item.Sum(x => x.Value.Imputed);

                entries.Add(new Entry(float.Parse(imputed.ToString()))
                {
                    Color      = GenerateColors.GetColor(indexColor),
                    TextColor  = GenerateColors.GetColor(indexColor),
                    Label      = TruncateLongString(tempTask.Value.Value.DisplayName, 20),
                    ValueLabel = TimeFormat.Format(imputed)
                });
                indexColor++;
            }

            return(entries);
        }
Exemplo n.º 2
0
        public List <Entry> GenerateChartImputationMonthVsHourMonthExpected(Models.Timesheet timesheet)
        {
            var entries         = new List <Microcharts.Entry>();
            var totalHoursMonth = (AppSettings.HoursDay * timesheet.Days.Where(x => x.IsClosed == false && x.IsWeekend == false && (x.Holiday == null || x.Holiday?.IsHolyday == false)).Count()) * 60;

            var consumed = timesheet.Activities.Sum(x => x.Value.Imputed);
            var pending  = totalHoursMonth - consumed;

            pending = pending < 0 ? pending = 0 : pending;

            entries.Add(new Entry(float.Parse(consumed.ToString()))
            {
                Color      = GenerateColors.GetColor(2),
                TextColor  = GenerateColors.GetColor(2),
                Label      = "Consumed",
                ValueLabel = TimeFormat.Format(consumed)
            });


            entries.Add(new Entry(float.Parse(pending.ToString()))
            {
                Color      = GenerateColors.GetColor(3),
                TextColor  = GenerateColors.GetColor(3),
                Label      = "Pending",
                ValueLabel = TimeFormat.Format(pending)
            });
            return(entries);
        }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        GameUtils.safeToPlay = true;
        tint = new Color();
        ColorUtility.TryParseHtmlString("#D5D5D5FF", out tint);
        rend = GetComponent <SpriteRenderer>();
        string correctColor = GenerateColors.colorText.text;

        beniAudio = GameObject.FindGameObjectWithTag("Beni").GetComponent <AudioSource>();
        color     = gameObject.tag;
        generator = GameObject.FindGameObjectWithTag("GameController").GetComponent <GenerateColors>();   //Used to generate new rounds
    }
Exemplo n.º 4
0
        public List <Entry> GenerateChartActivitiesImputationVsDeviation(Models.Timesheet timesheet)
        {
            var entries    = new List <Microcharts.Entry>();
            var imputed    = timesheet.Activities.Sum(x => x.Value.Imputed);
            var desviation = timesheet.Activities.Sum(x => x.Value.Deviation);

            entries.Add(new Entry(float.Parse(imputed.ToString()))
            {
                Color      = GenerateColors.GetColor(0),
                TextColor  = GenerateColors.GetColor(0),
                Label      = "Imputed",
                ValueLabel = TimeFormat.Format(imputed)
            });

            entries.Add(new Entry(float.Parse(desviation.ToString()))
            {
                Color      = GenerateColors.GetColor(1),
                TextColor  = GenerateColors.GetColor(1),
                Label      = "Deviation",
                ValueLabel = TimeFormat.Format(desviation)
            });

            return(entries);
        }