public void populateList(string result) { Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); for (int i = 0; i < dictionary["FName"].Count; i++) { string text = dictionary["FName"][i] ?? ""; Label item = new Label { Content = (text ?? ""), }; DataSwitch item2 = new DataSwitch(int.Parse(dictionary["IDKey"][i])) { }; DataSwitch item3 = new DataSwitch(int.Parse(dictionary["IDKey"][i])) { }; List <UIElement> list = new List <UIElement>() { item, item2, item3 }; GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true, true }); Favorites.Add(item2); Group.Add(item3); } }
public void populateResults(string result) { this.PurgeCells(); Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result), true); if (dictionary.Count > 1) { for (int i = 0; i < dictionary["uniqueid"].Count; i++) { string text = dictionary["calldate"][i] + " : " + FormatFunctions.PrettyPhone(dictionary["cnam"][i]); SecurityButton dataButton = new SecurityButton(int.Parse(Regex.Replace(dictionary["uniqueid"][i], "^[^.]+.", "")), new string[] { "Manager" }) { Content = text }; dataButton.Click += onClicked; dataButton.String = dictionary["calldate"][i]; dataButton.String2 = dictionary["recordingfile"][i]; List <UIElement> list = new List <UIElement> { dataButton }; GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true }); } } }
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); } } }
public void populateResults(string result) { this.PurgeCells(); Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result), true); if (dictionary.Count > 1) { for (int i = 0; i < dictionary["uniqueid"].Count; i++) { string text = dictionary["calldate"][i] + " : " + FormatFunctions.PrettyPhone(dictionary["cnam"][i]); SecurityButton dataButton = new SecurityButton(int.Parse(Regex.Replace(dictionary["uniqueid"][i], "^[^.]+.", "")), new string[] { "Manager" }) { Text = text, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.EndAndExpand }; dataButton.Clicked += onClicked; dataButton.String = dictionary["calldate"][i]; dataButton.String2 = dictionary["recordingfile"][i]; List <View> list = new List <View> { dataButton }; GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true }); } } }
public void populateFields(string result) { Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); this.entryDict = new List <DataPair>(); if (dictionary.Count > 0) { for (int i = 0; i < dictionary["Index"].Count; i++) { DataPair dataPair = new DataPair(int.Parse(dictionary["IDKey"][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; ViewCell viewCell = new ViewCell(); StackLayout stackLayout = new StackLayout { Orientation = StackOrientation.Horizontal }; this.entryDict.Add(dataPair); List <View> list = new List <View>(); list.Add(dataPair.Value); list.Add(dataPair.Index); GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true }); } } }
public void setupBoxes(string result) { Labels = new List <Label>(); checkBoxes = new List <UIElement>(); Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); uniqueIDs = dictionary["IDKey"]; uniqueNames = dictionary["FName"]; foreach (string s in uniqueIDs) {//Possible roles are: Sales, Installer List <UIElement> elements = new List <UIElement>(); elements.Add(new Label() { Content = s }); elements.Add(new DataDoubleSwitch(int.Parse(s), 0) { HorizontalAlignment = HorizontalAlignment.Center }); //Sales elements.Add(new DataDoubleSwitch(int.Parse(s), 1) { HorizontalAlignment = HorizontalAlignment.Center }); //Installer checkBoxes.AddRange(elements); GridFiller.rapidFillPremadeObjects(elements, BodyGrid, new bool[] { true, false, false }); } checkBoxes = FormatFunctions.scrubOutUnlessWanted(checkBoxes, new DataDoubleSwitch(0, 0), Labels); for (int j = 0; j < uniqueNames.Count; j++) { Labels[j].Content = uniqueNames[j]; } }
public void populateList(string result) { //DatabaseFunctions.SendToDebug("Beginning populating daily tasks"); Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); if (dictionary.Count > 1) { for (int i = 0; i < dictionary["Name"].Count; i++) { string text = dictionary["Name"][i] ?? ""; SecurityButton dataButton = new SecurityButton(int.Parse(dictionary["IDKey"][i]), new string[] { "Employee" }) { Text = text, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; dataButton.Clicked += this.onClicked; List <View> list = new List <View>(); list.Add(dataButton); GridFiller.rapidFillPremadeObjects(list, tasksList, new bool[] { true, true }); } } //DatabaseFunctions.SendToDebug("Finsihed populating daily tasks"); }
public void onClickAddFields(object sender, EventArgs e) { DataPair dataPair = new DataPair(0, "", ""); dataPair.setNew(); dataPair.Value.Text = ""; dataPair.Value.Placeholder = "Index here"; dataPair.Value.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); dataPair.Value.VerticalOptions = LayoutOptions.CenterAndExpand; dataPair.Value.HorizontalOptions = LayoutOptions.StartAndExpand; dataPair.Index.Text = ""; dataPair.Index.Placeholder = "Value here"; dataPair.Index.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); dataPair.Index.VerticalOptions = LayoutOptions.CenterAndExpand; dataPair.Index.HorizontalOptions = LayoutOptions.EndAndExpand; ViewCell viewCell = new ViewCell(); StackLayout stackLayout = new StackLayout { Orientation = StackOrientation.Horizontal }; List <View> list = new List <View>(); list.Add(dataPair.Value); list.Add(dataPair.Index); GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true }); this.entryDict.Add(dataPair); }
public void onClickAddPrefilledFieldsQ(object sender, EventArgs e) { FlaggedDataPair dataPair = new FlaggedDataPair(0, "", "", currentQuote); dataPair.setNew(); dataPair.Index.Text = PriceGuide.SelectedItem.ToString(); dataPair.Value.Text = prices[PriceGuide.SelectedIndex]; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; if (currentQuote == 0) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid1, new bool[] { true, true }); } else if (currentQuote == 1) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid2, new bool[] { true, true }); } else if (currentQuote == 2) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid3, new bool[] { true, true }); } else if (currentQuote == 3) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid4, new bool[] { true, true }); } else if (currentQuote == 4) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid5, new bool[] { true, true }); } entryDictQ.Add(dataPair); }
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); }
public void onClickAddFields(object sender, EventArgs e) { DataPair dataPair = new DataPair(0, "", ""); dataPair.setNew(); dataPair.Value.Text = ""; dataPair.Index.Text = ""; List <UIElement> list = new List <UIElement>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, MainGrid, new bool[] { true, true }); dp.Add(dataPair); }
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"; GridFiller.rapidFillPremadeObjects(new List <UIElement>() { dataPair.Index, dataPair.Value }, mainGrid, new bool[] { true, true }); this.entryDict.Add(dataPair); }
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 }); } } }
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 = 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") && dictionary["Value"][i] != "") { bookLabel.Date = DateTime.Parse(FormatFunctions.PrettyDate(dictionary["Value"][i])); } 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.Index.Text = FormatFunctions.PrettyDate(dictionary["Index"][i]); List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, BodyGrid, new bool[] { true, true }); entryDict.Add(dataPair); if (dictionary["Index"][i].Contains("dress")) { address = FormatFunctions.PrettyDate(dictionary["Value"][i]); } } } } renderBookingMap(address); FileList fl = new FileList(customer); GridHolder.Children.Add(fl); }
public void onClickAddFields(object sender, EventArgs e) { DataPair dataPair = new DataPair(0, "", ""); dataPair.setNew(); dataPair.Value.Text = ""; dataPair.Value.Placeholder = "Index here"; dataPair.Index.Text = ""; dataPair.Index.Placeholder = "Value here"; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, bodyGrid, new bool[] { true, true }); entryDict.Add(dataPair); }
public void onClickAddPrefilledFieldsQ(object sender, EventArgs e) { DataPair dataPair = new DataPair(0, "", ""); dataPair.setNew(); dataPair.Index.Text = PriceGuidecombo.SelectedItem.ToString(); dataPair.Index.Placeholder = "Item"; dataPair.Value.Text = prices[PriceGuidecombo.SelectedIndex]; dataPair.Value.Placeholder = "Amount"; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, quoteStack, new bool[] { true, true }); entryDictQ.Add(dataPair); }
public void populateFileList() { string[] customerFileList = DatabaseFunctions.getCustomerFileList(this.NameDisplay.Content.ToString()); foreach (string text in customerFileList) { if ((text != "." || text != "..") && customerFileList.Length > 1) { SecurityButton dataButton = new SecurityButton(this.NameDisplay.Content + "/" + text, new string[] { "Employee" }) { Content = text }; dataButton.Click += this.onFileButton; GridFiller.rapidFillPremadeObjects(new List <UIElement>() { dataButton }, mainGrid, new bool[] { false }); } } }
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 = dictionary["Value"][i]; dataPair.Value.Placeholder = "Item"; dataPair.Index.Text = dictionary["AdvValue"][i]; dataPair.Index.Placeholder = "Amount"; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; if (dictionary["TaskID"][i] == "0") { GridFiller.rapidFillPremadeObjects(list, QuoteGrid1, new bool[] { true, true }); } else if (dictionary["TaskID"][i] == "1") { GridFiller.rapidFillPremadeObjects(list, QuoteGrid2, new bool[] { true, true }); } else if (dictionary["TaskID"][i] == "2") { GridFiller.rapidFillPremadeObjects(list, QuoteGrid3, new bool[] { true, true }); } else if (dictionary["TaskID"][i] == "3") { GridFiller.rapidFillPremadeObjects(list, QuoteGrid4, new bool[] { true, true }); } else if (dictionary["TaskID"][i] == "4") { GridFiller.rapidFillPremadeObjects(list, QuoteGrid5, new bool[] { true, true }); } entryDictQ.Add(dataPair); } } }
public void populateList(string result) { string[] input = FormatFunctions.SplitToPairs(result); this.dict = FormatFunctions.createValuePairs(input); this.views = new List <ViewCell>(); if (this.dict.Count > 1) { this.buttonDict = new Dictionary <string, SecurityButton>(); this.switchDict = new List <DataSwitch>(); for (int i = 0; i < this.dict["Name"].Count; i++) { if (!this.buttonDict.ContainsKey(this.dict["IDKey"][i])) { string text = this.dict["Name"][i] ?? ""; SecurityButton dataButton = new SecurityButton(int.Parse(this.dict["IDKey"][i]), new string[] { "Employee" }) { Text = text, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; DataSwitch item = new DataSwitch(int.Parse(this.dict["IDKey"][i])) { VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.StartAndExpand }; dataButton.Clicked += this.onClicked; buttonDict.Add(this.dict["IDKey"][i], dataButton); switchDict.Add(item); List <View> list = new List <View>(); list.Add(dataButton); list.Add(item); GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true }); } else { SecurityButton dataButton2 = buttonDict[dict["IDKey"][i]]; dataButton2.Text = dataButton2.Text + ", " + dict["Value"][i]; } } } }
public void populateFileList() { string[] customerFileList = DatabaseFunctions.getCustomerFileList(nameLabel.Text); foreach (string text in customerFileList) { if ((text != "." || text != "..") && customerFileList.Length > 1) { SecurityButton dataButton = new SecurityButton(nameLabel.Text + "/" + text, new string[] { "Sales" }) { Content = text }; dataButton.Click += onFileButton; List <UIElement> list = new List <UIElement>() { dataButton }; GridFiller.rapidFillPremadeObjects(list, fileGrid, new bool[] { true, true }); } } }
public void populatePage(string result) { Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); entryDict = new List <DataPair>(); nameLabel.Text = dictionary["Name"][0]; if (dictionary.Count > 0) { for (int i = 0; i < dictionary["Index"].Count; i++) { if (dictionary["Index"][i].Contains("dress")) { address = dictionary["Value"][i]; contactLabel.Text = dictionary["Value"][i]; } else { DataPair dataPair = new DataPair(int.Parse(dictionary["FID"][i]), dictionary["Index"][i], dictionary["Value"][i]); dataPair.Value.Text = dictionary["Value"][i]; dataPair.Value.Placeholder = "Value here"; dataPair.Value.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); dataPair.Index.Text = dictionary["Index"][i]; dataPair.Index.Placeholder = "Index here"; dataPair.Index.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, BodyGrid, new bool[] { true, true }); entryDict.Add(dataPair); if (dictionary["Index"][i].Contains("hone")) { phoneLabel.Text = dictionary["Value"][i]; } } } } FileList fl = new FileList(customer); GridHolder.Children.Add(fl); }
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); } } }
public void populateFileList() { string[] customerFileList = DatabaseFunctions.getCustomerFileList(this.NameDisplay.Text); foreach (string text in customerFileList) { if ((text != "." || text != "..") && customerFileList.Length > 1) { SecurityButton dataButton = new SecurityButton(this.NameDisplay.Text + "/" + text, new string[] { "Employee" }) { Text = text, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; dataButton.Clicked += this.onFileButton; GridFiller.rapidFillPremadeObjects(new List <View>() { dataButton }, mainGrid, new bool[] { false }); } } }
public void populateFields(string result) { Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); this.entryDict = new List <DataPair>(); if (dictionary.Count > 0) { for (int i = 0; i < dictionary["Index"].Count; i++) { DataPair dataPair = new DataPair(int.Parse(dictionary["IDKey"][i]), FormatFunctions.CleanDateNew(dictionary["Value"][i]), FormatFunctions.CleanDateNew(dictionary["Index"][i])); dataPair.Value.Text = FormatFunctions.CleanDateNew(dictionary["Value"][i]); dataPair.Value.ToolTip = "Value here"; dataPair.Index.Text = FormatFunctions.CleanDateNew(dictionary["Index"][i]); dataPair.Index.ToolTip = "Index here"; this.entryDict.Add(dataPair); List <UIElement> list = new List <UIElement>(); list.Add(dataPair.Value); list.Add(dataPair.Index); GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true }); } } }
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.Placeholder = "Item"; dataPair.Index.Text = dictionary["AdvValue"][i]; dataPair.Index.Placeholder = "Amount"; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; GridFiller.rapidFillPremadeObjects(list, quoteStack, new bool[] { true, true }); entryDictQ.Add(dataPair); } } }
public void populateList(string result) { string[] input = FormatFunctions.SplitToPairs(result); this.dict = FormatFunctions.createValuePairs(input); if (this.dict.Count > 1) { this.buttonDict = new Dictionary <string, SecurityButton>(); this.switchDict = new List <DataSwitch>(); for (int i = 0; i < this.dict["Name"].Count; i++) { if (!this.buttonDict.ContainsKey(this.dict["IDKey"][i])) { string text = this.dict["Name"][i] ?? ""; SecurityButton dataButton = new SecurityButton(int.Parse(this.dict["IDKey"][i]), new string[] { "Employee" }) { Content = text, }; DataSwitch item = new DataSwitch(int.Parse(this.dict["IDKey"][i])) { }; dataButton.Click += this.onClicked; buttonDict.Add(this.dict["IDKey"][i], dataButton); switchDict.Add(item); List <UIElement> list = new List <UIElement>(); list.Add(dataButton); list.Add(item); GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true }); } else { SecurityButton dataButton2 = buttonDict[dict["IDKey"][i]]; dataButton2.Content = dataButton2.Content + ", " + dict["Value"][i]; } } } }
public void onClickAddFieldsQ(object sender, EventArgs e) { FlaggedDataPair dataPair = new FlaggedDataPair(0, "", "", currentQuote); dataPair.setNew(); dataPair.Value.Text = ""; dataPair.Value.Placeholder = "Item"; dataPair.Index.Text = ""; dataPair.Index.Placeholder = "Amount"; List <View> list = new List <View>() { dataPair.Index, dataPair.Value }; if (currentQuote == 0) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid1, new bool[] { true, true }); } else if (currentQuote == 1) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid2, new bool[] { true, true }); } else if (currentQuote == 2) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid3, new bool[] { true, true }); } else if (currentQuote == 3) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid4, new bool[] { true, true }); } else if (currentQuote == 4) { GridFiller.rapidFillPremadeObjects(list, QuoteGrid5, new bool[] { true, true }); } entryDictQ.Add(dataPair); }
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 }); }
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) }); }