Ejemplo n.º 1
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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void populateGrid(string result)
        {
            dp = new List <DataPair>();
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataPair         d    = new DataPair(int.Parse(dictionary["IDKey"][i]), dictionary["Index"][i], dictionary["Value"][i]);
                    List <UIElement> list = new List <UIElement>()
                    {
                        d.Index, d.Value
                    };
                    d.Index.Text = FormatFunctions.PrettyDate(dictionary["Index"][i]);
                    if (d.Index.Text.Contains("~"))
                    {
                        d.Value.Text = FormatFunctions.lookupAgentName(int.Parse(dictionary["Value"][i]));
                    }
                    else
                    {
                        d.Value.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    GridFiller.rapidFillPremadeObjects(list, bodyGrid, new bool[] { true, true });
                    dp.Add(d);
                }
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 4
0
        public void populateChat(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Message"].Count; i++)
                {
                    Label item = new Label
                    {
                        Text = string.Concat(new string[]
                        {
                            FormatFunctions.PrettyDate(dictionary["Timestamp"][i]),
                            ":",
                            dictionary["FName"][i],
                            ":",
                            dictionary["Message"][i]
                        }),
                        FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                        VerticalOptions   = LayoutOptions.Start,
                        HorizontalOptions = LayoutOptions.Start
                    };
                    ChatStack.Children.Add(item);
                }
            }
        }
Ejemplo n.º 5
0
        public void populateList(string result)
        {
            Dictionary <string, List <string> > dictionary  = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            Dictionary <string, SecurityButton> dictionary2 = new Dictionary <string, SecurityButton>();

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Name"].Count; i++)
                {
                    if (!dictionary2.ContainsKey(dictionary["IDKey"][i]))
                    {
                        string         text       = FormatFunctions.PrettyDate(dictionary["Name"][i]) + " ," + FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        SecurityButton dataButton = new SecurityButton(int.Parse(dictionary["IDKey"][i]), new string[] { "Employee" })
                        {
                            Content = text,
                            Width   = ClientData.sideFrame.Width * 0.925
                        };
                        dataButton.Click   += this.onClicked;
                        dataButton.Integer2 = int.Parse(dictionary["Stage"][i]);
                        List <UIElement> list = new List <UIElement>()
                        {
                            dataButton
                        };
                        bool[] box = new bool[] { false };
                        GridFiller.rapidFillPremadeObjectsStandardHeight(list, dataGrid, box, 25);
                        dictionary2.Add(dictionary["IDKey"][i], dataButton);
                    }
                    else
                    {
                        SecurityButton dataButton2 = dictionary2[dictionary["IDKey"][i]];
                        dataButton2.Content = dataButton2.Content + " ," + dictionary["Value"][i];
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict           = new List <DataPair>();
            NameDisplay.Content = FormatFunctions.PrettyDate(dictionary["Name"][0]);
            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Index"].Count; i++)
                {
                    DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["value"][i], dictionary["Index"][i]);
                    dataPair.Value.Text    = FormatFunctions.PrettyDate(dictionary["value"][i]);
                    dataPair.Value.ToolTip = "Value here";
                    dataPair.Index.Text    = FormatFunctions.PrettyDate(dictionary["Index"][i]);
                    dataPair.Index.ToolTip = "Index here";
                    List <UIElement> list = new List <UIElement>()
                    {
                        dataPair.Index, dataPair.Value
                    };
                    int[]  space = new int[] { 2, 2 };
                    bool[] box   = new bool[] { true, true };
                    GridFiller.rapidFillSpacedPremadeObjects(list, mainGrid, space, box);
                    this.entryDict.Add(dataPair);
                }
            }
            //this.populateFileList();
        }
Ejemplo n.º 7
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict = new List <DataPair>();
            string address = "";

            if (dictionary.Count > 0)
            {
                nameLabel.Text = FormatFunctions.PrettyDate(dictionary["Name"][0]);
                for (int i = 0; i < dictionary["Index"].Count; i++)
                {
                    if (dictionary["Index"][i].Contains("hone"))
                    {
                        phoneLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("otes"))
                    {
                        noteLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("ookin"))
                    {
                        BookingDate.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        scroll.Height    = 0;
                    }
                    else
                    {
                        DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["Value"][i], dictionary["Index"][i]);
                        dataPair.Value.Text    = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        dataPair.Value.ToolTip = "Value here";
                        dataPair.Value.Width   = ClientData.mainFrame.Width * 0.7 - 10;
                        dataPair.Index.Text    = FormatFunctions.PrettyDate(dictionary["Index"][i]);
                        dataPair.Index.ToolTip = "Index here";
                        dataPair.Index.Width   = ClientData.mainFrame.Width * 0.3 - 10;
                        StackPanel stackLayout = new StackPanel
                        {
                            Orientation = Orientation.Horizontal
                        };
                        stackLayout.Children.Add(dataPair.Index);
                        stackLayout.Children.Add(dataPair.Value);
                        BodyGrid.Children.Add(stackLayout);
                        entryDict.Add(dataPair);
                        if (dictionary["Index"][i].Contains("dress"))
                        {
                            address = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        }
                    }
                }
            }
            renderBookingMap(address);
            //populateFileList();
        }
Ejemplo n.º 8
0
        public void populateChat(string result)
        {
            GridFiller.PurgeAllGrid(ChatStack);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Message"].Count; i++)
                {
                    string[] s = new string[] { FormatFunctions.PrettyDate(dictionary["Timestamp"][i]) + ":" + dictionary["FName"][i] + ":" + FormatFunctions.PrettyDate(dictionary["Message"][i]) };
                    GridFiller.rapidFill(s, ChatStack);
                }
            }
        }
Ejemplo n.º 9
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict = new List <DataPair>();
            if (dictionary.Count > 0)
            {
                nameLabel.Text = dictionary["Name"][0];
                for (int i = 0; i < dictionary["Index"].Count; i++)
                {
                    if (dictionary["Index"][i].Contains("hone"))
                    {
                        phoneLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("alesMan"))
                    {
                        SalemanCombo.SelectedIndex = DatabaseFunctions.findIndexInList(salesmen, dictionary["Value"][i]);//TODO UPDATE with proper index checking
                    }
                    else if (dictionary["Index"][i].Contains("uoteTotal"))
                    {
                        QuoteTotal.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("ontactDate"))
                    {
                        contactLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else
                    {
                        DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["Index"][i], dictionary["Value"][i]);
                        dataPair.Value.Text        = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        dataPair.Value.Placeholder = "Value here";
                        dataPair.Index.Text        = FormatFunctions.PrettyDate(dictionary["Index"][i]);;
                        dataPair.Index.Placeholder = "Index here";
                        List <View> list = new List <View>()
                        {
                            dataPair.Index, dataPair.Value
                        };
                        GridFiller.rapidFillPremadeObjects(list, bottomStack, new bool[] { true, true });
                        entryDict.Add(dataPair);
                        if (dictionary["Index"][i].Contains("dress"))
                        {
                            address = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        }
                    }
                }
            }
            FileList fl = new FileList(customer);

            GridHolder.Children.Add(fl);
        }
Ejemplo n.º 10
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict = new List <DataPair>();
            if (dictionary.Count > 0)
            {
                nameLabel.Text = FormatFunctions.PrettyDate(dictionary["Name"][0]);
                for (int i = 0; i < dictionary["Index"].Count; i++)
                {
                    if (dictionary["Index"][i].Contains("hone"))
                    {
                        phoneLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("alesMan"))
                    {
                        SalemanCombo.SelectedIndex = DatabaseFunctions.findIndexInList(salesmen, dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("uoteTotal"))
                    {
                        QuoteTotal.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else if (dictionary["Index"][i].Contains("ontactDate"))
                    {
                        contactLabel.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    }
                    else
                    {
                        DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["Index"][i], dictionary["Value"][i]);
                        dataPair.Value.Text    = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        dataPair.Value.ToolTip = "Value here";
                        dataPair.Index.Text    = FormatFunctions.PrettyDate(dictionary["Index"][i]);;
                        dataPair.Index.ToolTip = "Index here";
                        List <UIElement> list = new List <UIElement>()
                        {
                            dataPair.Index, dataPair.Value
                        };
                        int[] j = new int[] { 2, 4 };
                        GridFiller.rapidFillSpacedPremadeObjects(list, bottomStack, j, new bool[] { true, true });
                        entryDict.Add(dataPair);
                        if (dictionary["Index"][i].Contains("dress"))
                        {
                            address = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                        }
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict = new List <DataPair>();
            if (dictionary.Count > 0)
            {
                nameLabel.Text = dictionary["Name"][0];
                for (int i = 0; i < dictionary["Index"].Count; i++)
                {
                    if (dictionary["Index"][i].Contains("ook") && dictionary["Value"][i] != "")
                    {
                        datePicker.Date = DateTime.Parse(FormatFunctions.PrettyDate(dictionary["Value"][i]));
                    }
                    else if (dictionary["Index"][i].Contains("otes"))
                    {
                        noteLabel.Text += dictionary["Value"][i];
                    }
                    else if (dictionary["Index"][i].Contains("dress"))
                    {
                        address           = dictionary["Value"][i];
                        addressLabel.Text = dictionary["Value"][i];
                    }
                    else
                    {
                        DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["Value"][i], dictionary["Index"][i]);
                        dataPair.Value.Text        = dictionary["Value"][i];
                        dataPair.Value.Placeholder = "Value here";
                        dataPair.Index.Text        = dictionary["Index"][i];
                        dataPair.Index.Placeholder = "Index here";
                        List <View> list = new List <View>()
                        {
                            dataPair.Index, dataPair.Value
                        };
                        GridFiller.rapidFillPremadeObjectsStandardHeight(list, bodyGrid, new bool[] { true, true }, 50);
                        entryDict.Add(dataPair);
                        if (dictionary["Index"][i].Contains("hone"))
                        {
                            phoneLabel.Text = dictionary["Value"][i];
                        }
                    }
                }
            }
            FileList fl = new FileList(customer);

            GridHolder.Children.Add(fl);
        }
Ejemplo n.º 12
0
        public void populatePend(string result)
        {
            GridFiller.PurgeHeader(DetailBody);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataButton b = new DataButton();
                    b.Content  = "Approve";
                    b.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b.Integer2 = int.Parse(dictionary["Approved"][i]);
                    if (dictionary["Approved"][i] == "1")
                    {
                        b.Background = new SolidColorBrush(ClientData.rotatingConfirmationColors[0]);
                        b.Content    = "Disapprove";
                    }
                    else
                    {
                        b.Background = new SolidColorBrush(ClientData.rotatingNegativeColors[0]);
                    }
                    b.Click += onClickApprove;
                    DataButton b2 = new DataButton();
                    b2.Content = "Add Note";
                    b2.Integer = int.Parse(dictionary["IDKey"][i]);
                    b2.Click  += onClickANote;
                    DataButton b3 = new DataButton();
                    b3.Content = "Alter";
                    b3.Integer = int.Parse(dictionary["IDKey"][i]);
                    b3.Click  += onClickOverrideTime;
                    Label T = new Label();
                    T.Content = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    Label L = new Label();
                    L.Content = FormatFunctions.PrettyDate(dictionary["Coordinates"][i]);
                    Label I = new Label();
                    I.Content = convertState(dictionary["State"][i]);
                    Label N = new Label();
                    N.Content = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    List <UIElement> list = new List <UIElement>()
                    {
                        b, b2, b3, T, L, I, N
                    };
                    GridFiller.rapidFillPremadeObjects(list, DetailBody, new bool[] { false, false, false, true, true, true, true });
                }
            }
        }
Ejemplo n.º 13
0
        public void populateQuoteList(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDictQ = new List <FlaggedDataPair>();
            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Value"].Count; i++)
                {
                    FlaggedDataPair dataPair = new FlaggedDataPair(0, dictionary["Value"][i], dictionary["AdvValue"][i], int.Parse(dictionary["TaskID"][i]));
                    dataPair.Value.Text    = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    dataPair.Value.ToolTip = "Item";
                    dataPair.Index.Text    = FormatFunctions.PrettyDate(dictionary["AdvValue"][i]);
                    dataPair.Index.ToolTip = "Amount";
                    List <UIElement> list = new List <UIElement>()
                    {
                        dataPair.Index, dataPair.Value
                    };
                    int[] j = new int[] { 2, 4 };
                    if (dictionary["TaskID"][i] == "0")
                    {
                        GridFiller.rapidFillSpacedPremadeObjects(list, Option1, j, new bool[] { true, true });
                    }
                    else if (dictionary["TaskID"][i] == "1")
                    {
                        GridFiller.rapidFillSpacedPremadeObjects(list, Option2, j, new bool[] { true, true });
                    }
                    else if (dictionary["TaskID"][i] == "2")
                    {
                        GridFiller.rapidFillSpacedPremadeObjects(list, Option3, j, new bool[] { true, true });
                    }
                    else if (dictionary["TaskID"][i] == "3")
                    {
                        GridFiller.rapidFillSpacedPremadeObjects(list, Option4, j, new bool[] { true, true });
                    }
                    else if (dictionary["TaskID"][i] == "4")
                    {
                        GridFiller.rapidFillSpacedPremadeObjects(list, Option5, j, new bool[] { true, true });
                    }
                    entryDictQ.Add(dataPair);
                }
            }
        }
Ejemplo n.º 14
0
        public void populatePend(string result)
        {
            GridFiller.PurgeHeader(ApproveBody);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataButton b = new DataButton();
                    b.Text     = "Approve";
                    b.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b.Integer2 = int.Parse(dictionary["Approved"][i]);
                    if (dictionary["Approved"][i] == "1")
                    {
                        b.BackgroundColor = ClientData.rotatingConfirmationColors[0];
                        b.Text            = "Disapprove";
                    }
                    else
                    {
                        b.BackgroundColor = ClientData.rotatingNegativeColors[0];
                    }
                    b.Clicked += onClickApprove;
                    DataButton b2 = new DataButton();
                    b2.Text     = "Add Note";
                    b2.Integer  = int.Parse(dictionary["IDKey"][i]);
                    b2.Clicked += onClickANote;
                    Label T = new Label();
                    T.Text = FormatFunctions.PrettyDate(dictionary["TimeStamp"][i]);
                    Label L = new Label();
                    L.Text = FormatFunctions.PrettyDate(dictionary["Coordinates"][i]);
                    Label I = new Label();
                    I.Text = convertState(dictionary["State"][i]);
                    Label N = new Label();
                    N.Text = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    List <View> list = new List <View>()
                    {
                        b, b2, T, L, I, N
                    };
                    GridFiller.rapidFillPremadeObjectsStandardHeight(list, ApproveBody, new bool[] { false, false, true, true, true, true }, 50);
                }
            }
        }
Ejemplo n.º 15
0
        public void populateTardiness(string result)
        {
            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["Date"][i]);
                    y[1] = "";
                    y[2] = FormatFunctions.PrettyDate(dictionary["Note"][i]);
                    y[3] = FormatFunctions.PrettyDate(dictionary["RecordType"][i]);
                    GridFiller.rapidFill(y, BodyGrid);
                }
            }
        }
Ejemplo n.º 16
0
        public void TombstonePrinter(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            NameEntry.Text = FormatFunctions.PrettyDate(dictionary["Name"][0]);
            for (int i = 0; i < dictionary["Name"].Count; i++)
            {
                if (dictionary["Index"][i].Contains("Address"))
                {
                    Address.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                }
                else if (dictionary["Index"][i].Contains("Phone"))
                {
                    Phone.Text = FormatFunctions.PrettyPhone(dictionary["Value"][i]);
                }
                else if (dictionary["Index"][i].Contains("Email"))
                {
                    Email.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                }
                else if (dictionary["Index"][i].Contains("Region"))
                {
                    Region.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                }
                else if (dictionary["Index"][i].Contains("First Contact"))
                {
                    FirstContact.SelectedDate = DateTime.Parse(FormatFunctions.PrettyDate(dictionary["Value"][i]));
                }
                else if (dictionary["Index"][i].Contains("Last Contact"))
                {
                    LastContact.SelectedDate = DateTime.Parse(FormatFunctions.PrettyDate(dictionary["Value"][i]));
                }
                else if (dictionary["Index"][i].Contains("Source"))
                {
                    Source.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                }
                else if (dictionary["Index"][i].Contains("Postal"))
                {
                    Postal.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                }
            }
        }
Ejemplo n.º 17
0
        public void populateGrid(string result)
        {//TODO port to new Mobile friendly version from desktop
            dp = new List <DataPair>();
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    DataPair    d    = new DataPair(int.Parse(dictionary["IDKey"][i]), dictionary["Index"][i], dictionary["Value"][i]);
                    List <View> list = new List <View>()
                    {
                        d.Index, d.Value
                    };
                    GridFiller.rapidFillPremadeObjects(list, MainGrid, new bool[] { true, true });
                    d.Value.Text = FormatFunctions.PrettyDate(dictionary["Value"][i]);
                    d.Index.Text = FormatFunctions.PrettyDate(dictionary["Index"][i]);
                    dp.Add(d);
                }
            }
        }
Ejemplo n.º 18
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);
                }
            }
        }
Ejemplo n.º 19
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;
            }
        }
Ejemplo n.º 20
0
        public void populateFields(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            for (int i = 0; i < dictionary["IDKey"].Count; i++)
            {
                DataEntry item = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Value"][i])
                {
                    Text = FormatFunctions.PrettyDate(dictionary["Value"][i])
                };
                DataEntry item2 = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Index"][i])
                {
                    Text = FormatFunctions.PrettyDate(dictionary["Index"][i])
                };
                List <UIElement> list = new List <UIElement>()
                {
                    item, item2
                };
                int[] j = new int[] { 3, 3 };
                GridFiller.rapidFillSpacedPremadeObjects(list, gridStack, j, new bool[] { true, true });
                this.Values.Add(item);
                this.Names.Add(item2);
            }
        }
Ejemplo n.º 21
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], convertState(dictionary["State"][0]), dictionary["Coordinates"][0], FormatFunctions.PrettyDate(dictionary["TimeStamp"][0]), FormatFunctions.getAgeOfTimestamp(FormatFunctions.PrettyDate(dictionary["TimeStamp"][0])), dictionary["Note"][0] };
                GridFiller.rapidFill(s, LiveBody);
            }
        }