Beispiel #1
0
        public void populateResults(string result)
        {
            this.views = new List <ViewCell>();
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result), true);

            if (dictionary.Count > 1)
            {
                for (int i = 0; i < dictionary["eventtime"].Count; i++)
                {
                    string c;
                    bool   CC = false;
                    if (dictionary["eventtype"][i] == "ANSWER")
                    {
                        c  = "Yes";
                        CC = true;
                    }
                    else
                    {
                        c = "No";
                    }
                    string[] s = new string[3] {
                        FormatFunctions.PrettyPhone(dictionary["cid_num"][i]), dictionary["eventtime"][i], c
                    };
                    GridFiller.rapidFillColorized(s, TSection, CC);
                }
            }
        }
Beispiel #2
0
        public void populatePunches(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                GridFiller.PurgeGrid(logGrid);
                string[] list = new string[3];
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    list[0] = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    list[2] = FormatFunctions.PrettyDate(dictionary["State"][i]);
                    list[1] = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    if (list[2] != "less")
                    {
                        GridFiller.rapidFillColorized(list, logGrid, bool.Parse(list[2]));
                    }
                    else
                    {
                        list[2] = "Location Log";
                        GridFiller.rapidFill(list, logGrid);
                    }
                }
            }
        }
Beispiel #3
0
        public void populateStamps(string result)
        {
            GridFiller.PurgeHeader(HourCalcBody);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            List <string> clockin  = new List <string>();
            List <string> clockout = new List <string>();

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    string[] y = new string[2];
                    y[0] = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    y[1] = convertState(dictionary["State"][i]);
                    if (dictionary["State"][i] == "True")
                    {
                        GridFiller.rapidFillColorized(y, HourCalcBody, true);
                        clockin.Add(FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]));
                    }
                    else if (dictionary["State"][i] == "False")
                    {
                        GridFiller.rapidFillColorized(y, HourCalcBody, false);
                        clockout.Add(FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]));
                    }
                    else
                    {
                        GridFiller.rapidFill(y, HourCalcBody);
                    }
                }
                double x = calculateHours(clockin, clockout) / 60;
                HourDisplay.Text = "Total Hours: " + x;
            }
        }
Beispiel #4
0
        public void populateLiveFeed(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                string[] s = new string[] { dictionary["FName"][0], FormatFunctions.PrettyDate(dictionary["TimeStamp"][0]), dictionary["Coordinates"][0] };

                if (dictionary["State"][0] == "True")
                {
                    GridFiller.rapidFillColorized(s, LiveBody, true);
                }
                else if (dictionary["State"][0] == "False")
                {
                    GridFiller.rapidFillColorized(s, LiveBody, false);
                }
                else
                {
                    GridFiller.rapidFill(s, LiveBody);
                }
            }
        }
Beispiel #5
0
        public void populateStamps(string result)
        {
            GridFiller.PurgeHeader(BodyGrid);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            List <string> clockin  = new List <string>();
            List <string> clockout = new List <string>();

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    string[] y = new string[4];
                    y[0] = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    y[1] = FormatFunctions.PrettyDate(dictionary["Coordinates"][i]);
                    y[2] = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    y[3] = convertState(dictionary["State"][i]);
                    if (dictionary["State"][i] == "True")
                    {
                        GridFiller.rapidFillColorized(y, BodyGrid, true);
                        clockin.Add(FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]));
                    }
                    else if (dictionary["State"][i] == "False")
                    {
                        GridFiller.rapidFillColorized(y, BodyGrid, false);
                        clockout.Add(FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]));
                    }
                    else
                    {
                        GridFiller.rapidFill(y, BodyGrid);
                    }
                }
                double x = calculateHours(clockin, clockout) / 60;
                HourDisplay.Content  = "Total Hours: " + x;
                AgentDisplay.Content = "Viewing: " + Agent.SelectedValue;
                WeekDisplay.Content  = "Week of: " + DayPicker.SelectedDate;
            }
        }