Beispiel #1
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 #2
0
        public void populatePunches(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                GridFiller.PurgeHeader(logGrid);
                string[] list = new string[3];
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    list[0] = dictionary["Note"][i];
                    list[2] = 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 populateTardiGrid(string result)
        {
            GridFiller.PurgeHeader(TardiGrid);
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            int sick  = 0;
            int tardy = 0;

            if (dictionary["IDKey"].Count > 0)
            {
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    GridFiller.rapidFill(new string[] { dictionary["RecordType"][i], dictionary["Date"][i], dictionary["Note"][i] }, TardiGrid);
                    if (dictionary["RecordType"][i] == "Sick")
                    {
                        sick++;
                    }
                    else if (dictionary["RecordType"][i] == "Tardy")
                    {
                        tardy++;
                    }
                }
            }
            Sick.Content = "Sick Days: " + sick;
            Late.Content = "Late Days: " + tardy;
        }
Beispiel #4
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 });
                }
            }
        }
Beispiel #5
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);
                }
            }
        }
Beispiel #6
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;
            }
        }