Example #1
0
        public void populatePage(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDict        = new List <DataPair>();
            NameDisplay.Text = 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              = dictionary["value"][i];
                    dataPair.Value.Placeholder       = "Value here";
                    dataPair.Value.FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label));
                    dataPair.Value.VerticalOptions   = LayoutOptions.CenterAndExpand;
                    dataPair.Value.HorizontalOptions = LayoutOptions.StartAndExpand;
                    dataPair.Index.Text              = dictionary["Index"][i];
                    dataPair.Index.Placeholder       = "Index here";
                    dataPair.Index.FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label));
                    dataPair.Index.VerticalOptions   = LayoutOptions.CenterAndExpand;
                    dataPair.Index.HorizontalOptions = LayoutOptions.EndAndExpand;
                    List <View> list = new List <View>()
                    {
                        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();
        }
        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();
        }
Example #3
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]);
                        }
                    }
                }
            }
        }
Example #4
0
        public void onClickAddPrefilledFieldsQ(object sender, RoutedEventArgs e)
        {
            DataPair dataPair = new DataPair(0, "", "");

            dataPair.setNew();
            dataPair.Index.Text    = PriceGuidecombo.SelectedItem.ToString();
            dataPair.Index.ToolTip = "Item";
            dataPair.Value.Text    = prices[PriceGuidecombo.SelectedIndex];
            dataPair.Value.ToolTip = "Amount";
            List <UIElement> list = new List <UIElement>()
            {
                dataPair.Index, dataPair.Value
            };

            int[] i = new int[] { 3, 3 };
            GridFiller.rapidFillSpacedPremadeObjects(list, quoteStack, i, new bool[] { true, true });
            entryDictQ.Add(dataPair);
        }
Example #5
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);
                }
            }
        }
Example #6
0
        public void onClickAddFields(object sender, RoutedEventArgs e)
        {
            DataPair dataPair = new DataPair(0, "", "");

            dataPair.setNew();
            dataPair.Value.Text    = "";
            dataPair.Value.ToolTip = "Index here";
            dataPair.Index.Text    = "";
            dataPair.Index.ToolTip = "Value here";

            List <UIElement> list = new List <UIElement>()
            {
                dataPair.Index, dataPair.Value
            };

            int[] i = new int[] { 2, 4 };
            GridFiller.rapidFillSpacedPremadeObjects(list, bottomStack, i, new bool[] { true, true });
            entryDictQ.Add(dataPair);
            entryDict.Add(dataPair);
            Button x = (Button)sender;

            if (x != row)
            {
                if (x == sig)
                {
                    dataPair.Index.Text = "Signature";
                    dataPair.Value.Text = "True";
                }
                if (x == fie)
                {
                    dataPair.Index.Text = "Deposit Received";
                    dataPair.Value.Text = "True";
                }
                if (x == met)
                {
                    dataPair.Index.Text = "Payment Method";
                }
            }
        }
Example #7
0
        public void onClickAddFieldsQ(object sender, RoutedEventArgs e)
        {
            FlaggedDataPair dataPair = new FlaggedDataPair(0, "", "", Tab.SelectedIndex);

            dataPair.setNew();
            dataPair.Index.Text    = "";
            dataPair.Index.ToolTip = "Item";
            dataPair.Value.Text    = "";
            dataPair.Value.ToolTip = "Amount";
            List <UIElement> list = new List <UIElement>()
            {
                dataPair.Index, dataPair.Value
            };

            int[] i = new int[] { 3, 3 };

            if (Tab.SelectedIndex == 0)
            {
                GridFiller.rapidFillSpacedPremadeObjects(list, Option1, i, new bool[] { true, true });
            }
            else if (Tab.SelectedIndex == 1)
            {
                GridFiller.rapidFillSpacedPremadeObjects(list, Option2, i, new bool[] { true, true });
            }
            else if (Tab.SelectedIndex == 2)
            {
                GridFiller.rapidFillSpacedPremadeObjects(list, Option3, i, new bool[] { true, true });
            }
            else if (Tab.SelectedIndex == 3)
            {
                GridFiller.rapidFillSpacedPremadeObjects(list, Option4, i, new bool[] { true, true });
            }
            else if (Tab.SelectedIndex == 4)
            {
                GridFiller.rapidFillSpacedPremadeObjects(list, Option5, i, new bool[] { true, true });
            }
            entryDictQ.Add(dataPair);
        }
        public void onClickAddFields(object sender, RoutedEventArgs e)
        {
            DataEntry item = new DataEntry(0, "")
            {
                Text    = "",
                ToolTip = "Value here"
            };
            DataEntry item2 = new DataEntry(0, "")
            {
                Text    = "",
                ToolTip = "Name here"
            };

            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);
        }
        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);
            }
        }
Example #10
0
        public void populateQuoteList(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            entryDictQ = new List <DataPair>();
            if (dictionary.Count > 0)
            {
                for (int i = 0; i < dictionary["Value"].Count; i++)
                {
                    DataPair dataPair = new DataPair(0, dictionary["Value"][i], dictionary["AdvValue"][i]);
                    dataPair.Value.Text    = dictionary["Value"][i];
                    dataPair.Value.ToolTip = "Item";
                    dataPair.Index.Text    = dictionary["AdvValue"][i];
                    dataPair.Index.ToolTip = "Amount";
                    List <UIElement> list = new List <UIElement>()
                    {
                        dataPair.Index, dataPair.Value
                    };
                    int[] j = new int[] { 2, 4 };
                    GridFiller.rapidFillSpacedPremadeObjects(list, quoteStack, j, new bool[] { true, true });
                    entryDictQ.Add(dataPair);
                }
            }
        }
Example #11
0
        public void populateSearch(string result)
        {
            PurgeCells();
            printHeader();
            TSection.Background = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            if (dictionary.Count > 0)
            {
                EditDict = new Dictionary <int, List <UIElement> >();
                for (int i = 0; i < dictionary["IDKey"].Count; i++)
                {
                    if (!(bool)EditMode.IsChecked)
                    {
                        string[] s     = new string[] { dictionary["Desc1"][i], dictionary["Desc2"][i], "$" + dictionary["Price"][i], "$" + dictionary["PriceSale"][i] };
                        int      count = 4;
                        if (BrandPicker.SelectedIndex == -1 || !BrandPicker.SelectedItem.Equals("Additives"))
                        {
                            count++;
                            s = new string[] { dictionary["Brand"][i], s[0], s[1], s[2], s[3] };
                        }
                        if (TypePicker.SelectedIndex == -1)
                        {
                            count++;
                            if (count == 6)
                            {
                                s = new string[] { dictionary["ItemType"][i], s[0], s[1], s[2], s[3], s[4] };
                            }
                            else
                            {
                                s = new string[] { dictionary["ItemType"][i], s[0], s[1], s[2], s[3] };
                            }
                        }
                        int[] Spacing = new int[] { 1, 1, 1, 1, 1, 1 };
                        if (s.Length == 5)
                        {
                            Spacing = new int[] { 1, 2, 1, 1, 1 };
                        }
                        else if (s.Length == 4)
                        {
                            Spacing = new int[] { 2, 2, 1, 1 };
                        }
                        GridFiller.rapidFillSpaced(s, TSection, Spacing);
                    }
                    else
                    {
                        int[]     Spacing = new int[] { 1, 1, 1, 1, 1, 1 };
                        DataEntry Desc1   = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Desc1"][i])
                        {
                            Text = dictionary["Desc1"][i]
                        };
                        DataEntry Desc2 = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Desc2"][i])
                        {
                            Text = dictionary["Desc2"][i]
                        };
                        DataEntry Price = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Price"][i])
                        {
                            Text = dictionary["Price"][i]
                        };
                        DataEntry PriceSale = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["PriceSale"][i])
                        {
                            Text = dictionary["PriceSale"][i]
                        };
                        DataEntry Brand = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["Brand"][i])
                        {
                            Text = dictionary["Brand"][i]
                        };
                        DataEntry ItemType = new DataEntry(int.Parse(dictionary["IDKey"][i]), dictionary["ItemType"][i])
                        {
                            Text = dictionary["ItemType"][i]
                        };
                        List <UIElement> list = new List <UIElement>()
                        {
                            Desc1, Desc2, Price, PriceSale, Brand, ItemType
                        };
                        EditDict.Add(int.Parse(dictionary["IDKey"][i]), list);
                        GridFiller.rapidFillSpacedPremadeObjects(list, TSection, Spacing, new bool[] { false, false, false, false, false, false });
                    }
                }
            }
        }
Example #12
0
        public void InitializeComponent()
        {
            scroll = new ScrollViewer();
            scroll.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            holder      = new StackPanel();
            controlGrid = new Grid();
            bodyGrid    = new Grid();
            controlGrid = new Grid()
            {
                Background = new SolidColorBrush(Color.FromRgb(0, 0, 0))
            };
            bodyGrid = new Grid()
            {
                Background = new SolidColorBrush(Color.FromRgb(0, 0, 0))
            };                                //Create the grids
            holder.Children.Add(controlGrid); //Add the grids to the holder
            holder.Children.Add(bodyGrid);
            scroll.Content = holder;
            Content        = scroll;
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(10, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(10, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(10, GridUnitType.Star)
            });
            Add = new StyledButton()
            {
                Content = "Add Field"
            };
            Add.Click += onClickAddFields;
            Save       = new StyledButton()
            {
                Content = "Save Changes"
            };
            Save.Click += onClickSave;
            Advance     = new StyledButton()
            {
                Content = "Advance"
            };
            Advance.Click += onClickAdvance;
            NameLabel      = new Label()
            {
                Content = "Job Name:"
            };
            NameBox    = new TextBox();
            StageLabel = new Label();
            List <UIElement> uIs = new List <UIElement>()
            {
                NameLabel, NameBox, StageLabel
            };

            GridFiller.rapidFillPremadeObjects(uIs, controlGrid, new bool[] { true, true, true });
            uIs = new List <UIElement>()
            {
                Add, Advance, Save
            };
            GridFiller.rapidFillPremadeObjects(uIs, controlGrid, new bool[] { false, false, false });
            Label l1 = new Label()
            {
                Content = "Index"
            };
            Label l2 = new Label()
            {
                Content = "Value"
            };

            uIs = new List <UIElement>()
            {
                l1, l2
            };
            GridFiller.rapidFillSpacedPremadeObjects(uIs, controlGrid, new int[] { 1, 2 }, new bool[] { true, true });
            bodyGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(10, GridUnitType.Star)
            });
            bodyGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(20, GridUnitType.Star)
            });
        }
Example #13
0
        public void Initialize()
        {
            holder      = new StackPanel();
            controlGrid = new Grid()
            {
                Background = new SolidColorBrush(Color.FromRgb(0, 0, 0))
            };
            Content = holder;
            holder.Children.Add(controlGrid);
            Header = "Customer Info";
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(7, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(20, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(7, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(20, GridUnitType.Star)
            });


            Save = new Button()
            {
                Content = "Save"
            };
            Add = new Button()
            {
                Content = "Add New Job"
            };
            Files = new Button()
            {
                Content = "Customer Files"
            };
            Save.Click  += onClickSave;
            Add.Click   += onClickAddJob;
            Files.Click += onFileButton;
            Address      = new TextBox();
            NameEntry    = new TextBox();
            Phone        = new TextBox();
            Email        = new TextBox();
            Region       = new TextBox();
            Source       = new TextBox();
            FirstContact = new DatePicker();
            LastContact  = new DatePicker();
            Postal       = new TextBox();
            Label NameLabel = new Label()
            {
                Content = "Name:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label AddressLabel = new Label()
            {
                Content = "Address:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label PhoneLabel = new Label()
            {
                Content = "Phone:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label EmailLabel = new Label()
            {
                Content = "Email:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label RegionLabel = new Label()
            {
                Content = "Region:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label SourceLabel = new Label()
            {
                Content = "Source:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label FirstLabel = new Label()
            {
                Content = "First Contact:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label LastLabel = new Label()
            {
                Content = "Last Contact:", HorizontalAlignment = HorizontalAlignment.Right
            };
            Label PostalLabel = new Label()
            {
                Content = "Postal Code:", HorizontalAlignment = HorizontalAlignment.Right
            };
            List <UIElement> list = new List <UIElement>()
            {
                Add, Save
            };

            GridFiller.rapidFillSpacedPremadeObjects(list, controlGrid, new int[] { 2, 2 }, new bool[] { false, false });
            list = new List <UIElement>()
            {
                Files
            };
            GridFiller.rapidFillSpacedPremadeObjects(list, controlGrid, new int[] { 1 }, new bool[] { false });
            list = new List <UIElement>()
            {
                NameLabel, NameEntry, AddressLabel, Address
            };
            GridFiller.rapidFillPremadeObjects(list, controlGrid, new bool[] { true, true, true, true });
            list = new List <UIElement>()
            {
                PhoneLabel, Phone, EmailLabel, Email
            };
            GridFiller.rapidFillPremadeObjects(list, controlGrid, new bool[] { true, true, true, true });
            list = new List <UIElement>()
            {
                RegionLabel, Region, SourceLabel, Source
            };
            GridFiller.rapidFillPremadeObjects(list, controlGrid, new bool[] { true, true, true, true });
            list = new List <UIElement>()
            {
                FirstLabel, FirstContact, LastLabel, LastContact
            };
            GridFiller.rapidFillPremadeObjects(list, controlGrid, new bool[] { true, true, true, true });
            list = new List <UIElement>()
            {
                PostalLabel, Postal
            };
            GridFiller.rapidFillPremadeObjects(list, controlGrid, new bool[] { true, true });
        }