private void button1_Click(object sender, EventArgs e) { TabForm tf = new TabForm(); if (tf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (tf.DisplayName == "") { MessageBox.Show("Please Enter a Display Name", "Please Enter a Display Name", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } Tabs.Tab t = new Tabs.Tab(); t.DisplayName = tf.DisplayName; t.ExcludeFromAutoSearch = tf.ExcludeFromAutoSearch; t.ExcludeKeywords = tf.UseExcludeKeywordList; t.ExcludeSellers = tf.UseExcludeSellerList; t.Index = listBox1.Items.Count; t.Name = tf.DisplayName.Replace(" ", "_"); Tabs.TabList.Add(t); listBox1.Items.Add(t); } Tabs.SaveTabs(); onTabsUpdated(); }
private void button3_Click(object sender, EventArgs e) { if (listBox1.SelectedIndices.Count > 0) { Tabs.Tab oldtab = (Tabs.Tab)listBox1.SelectedItem; TabForm tf = new TabForm(); tf.DisplayName = oldtab.DisplayName; tf.ExcludeFromAutoSearch = oldtab.ExcludeFromAutoSearch; tf.UseExcludeSellerList = oldtab.ExcludeSellers; tf.UseExcludeKeywordList = oldtab.ExcludeKeywords; if (tf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Tabs.Tab newtab = new Tabs.Tab(); newtab.Index = oldtab.Index; newtab.Name = oldtab.Name; newtab.DisplayName = tf.DisplayName; newtab.ExcludeFromAutoSearch = tf.ExcludeFromAutoSearch; newtab.ExcludeSellers = tf.UseExcludeSellerList; newtab.ExcludeKeywords = tf.UseExcludeKeywordList; Tabs.TabList.RemoveAt(listBox1.SelectedIndex); Tabs.TabList.Insert(listBox1.SelectedIndex, newtab); //update the searches with the new details... Tabs.SaveTabs(); LoadTabs(); onTabsUpdated(); } } }
private void MoveDown() { if (listBox1.SelectedIndex < 0) { return; } int curent = listBox1.SelectedIndex; if (curent < (listBox1.Items.Count - 1)) { Tabs.Tab curentab = Tabs.TabList[curent]; Tabs.Tab lasttab = Tabs.TabList[curent + 1]; Tabs.TabList.RemoveAt(curent); Tabs.TabList.RemoveAt(curent); curentab.Index = curentab.Index + 1; lasttab.Index = lasttab.Index - 1; Tabs.TabList.Insert(curent, lasttab); Tabs.TabList.Insert(curent + 1, curentab); listBox1.Items.RemoveAt(curent); listBox1.Items.RemoveAt(curent); listBox1.Items.Insert(lasttab.Index, lasttab); listBox1.Items.Insert(curentab.Index, curentab); } for (int it = 0; it < Tabs.TabList.Count; it++) { Tabs.TabList[it].Index = it; } Tabs.SaveTabs(); onTabsUpdated(); }
private void MoveUp() { //mov up int curent = listBox1.SelectedIndex; if (curent > 0) { Tabs.Tab curentab = Tabs.TabList[curent]; Tabs.Tab lasttab = Tabs.TabList[curent - 1]; Tabs.TabList.RemoveAt(curent); Tabs.TabList.RemoveAt(curent - 1); curentab.Index = curentab.Index - 1; lasttab.Index = lasttab.Index + 1; Tabs.TabList.Insert(curent - 1, curentab); Tabs.TabList.Insert(curent, lasttab); listBox1.Items.RemoveAt(curent); listBox1.Items.RemoveAt(curent - 1); listBox1.Items.Insert(curent - 1, curentab); listBox1.Items.Insert(curent, lasttab); } //for (int it = 0; it < Tabs.TabList.Count; it++) //{ // Tabs.TabList[it].Index = it; //} Tabs.SaveTabs(); onTabsUpdated(); }
public TabForm(Tabs.Tab Tab) { InitializeComponent(); }
public findItemsAdvancedResponse Search(SearchType Search, eBayServiceCredentials.GlobalID GlobalId) { eBayServiceCredentials creds = new eBayServiceCredentials(); creds.SECURITY_APPNAME = "Kimberle-7d94-45a7-a79d-344c094ee62b"; creds.SERVICE_VERSION = "1.11.0"; creds.xEBAY_SOA_GLOBAL_ID = GlobalId;// eBayServiceCredentials.GlobalID.GB; findItemsAdvanced fia = new findItemsAdvanced(); fia.Affiliate = new Affiliate() { NetworkID = Affiliate.NetWorkID.eBayPartnerNetwork, TrackingId = "5338256679", CustomID = "ESA" }; fia.Credentials = creds; if (Search.DescriptionSearch) { fia.DescriptionSearch = Search.DescriptionSearch; } fia.ItemFilterList = new findItemsAdvanced.ItemFilters(); fia.ItemFilterList.LocatedInUsed = true; fia.ItemFilterList.LocatedIn = eBayServiceCredentials.GlobalID.GB; findItemsAdvanced.eBaySortOrder so = findItemsAdvanced.eBaySortOrder.StartTimeNewest; if (Search.UsePriceRange) { fia.ItemFilterList.MaxPrice = Search.MaxPrice; fia.ItemFilterList.MinPrice = Search.MinPrice; } if (Search.IncludeAuctionsWithoutBIN) { } else { fia.ItemFilterList.ListingTypes = new List <findItemsAdvanced.ItemFilters.eBayListingType>(); fia.ItemFilterList.ListingTypes.Add(findItemsAdvanced.ItemFilters.eBayListingType.FixedPrice); } fia.ItemFilterList.HideDuplicateItems = true; if (Search.OnlyPaypal) { fia.ItemFilterList.PaymentMethods = new List <eBayPaymentMethod>(); fia.ItemFilterList.PaymentMethods.Add(eBayPaymentMethod.PayPal); } //start exclude sellers if (Search.ExcludeSellers != null) { fia.ItemFilterList.ExcludeSellers = Search.ExcludeSellers; } //find out if this tab has an exclusions Tabs.Tab tabby = null; foreach (Tabs.Tab t in Tabs.TabList) { if (t.Name == Search.SearchTab.Name) { tabby = t; } } //end exclude sellers if (Search.ExcludeKeywords != null) { fia.ExcludeKeywords = Search.ExcludeKeywords; } if (tabby.ExcludeKeywords) { string excKeyowordssFile = Settings.Default.ExcludeKeywordsFile; if (File.Exists(excKeyowordssFile)) { if (File.Exists(excKeyowordssFile)) { //load file and append to the excludesellers... string exList = File.ReadAllText(excKeyowordssFile); string[] words = exList.Split(new char[] { ',' }); foreach (string word in words) { fia.ExcludeKeywords.Add(word); } } } } if (Search.Conditions != null) { fia.ItemFilterList.ConditionTypes = new List <int>(); foreach (int co in Search.Conditions) { fia.ItemFilterList.ConditionTypes.Add(co); } } if (Search.Proximity != null) { fia.ItemFilterList.Proximity = Search.Proximity; } findItemsAdvanced.PaginationInput pi = new findItemsAdvanced.PaginationInput(); pi.EntriesPerPage = 25; pi.PageNumber = 1; findItemsAdvancedResponse fir; if (Search.Category != null) { fir = fia.Search(urlEncode(Search.Query), Search.Category.CategoryID, so, pi); } else { fir = fia.Search(urlEncode(Search.Query), so, pi); } //start to update the serch totalitems and bestprice etc... // SetSearchValues(fir, Search); return(fir); }
private void SetSearchValues(SearchType Search) { this.Tag = Search; currentSearchType = Search; textBoxDisplayName.Text = Search.DisplayName; //textBoxDisplayName.Enabled = false; this.Text = "Editing Search: " + Search.DisplayName; if (Search.Category != null) { textBoxCategory.Tag = Search.Category; textBoxCategory.Text = Search.Category.CategoryName + "(" + Search.Category.CategoryID.ToString() + ")"; } textBoxQuery.Text = Search.Query; Tabs.Tab tab = Search.SearchTab; comboTabs.Text = tab.Name; comboTabs.Tag = tab; for (int o = 0; o < comboTabs.Items.Count; o++) { if (comboTabs.Items[o].ToString() == tab.Name.Replace("_", " ")) { comboTabs.SelectedIndex = o; } } //tab.ExcludeKeywords checkBoxUsePrices.Checked = Search.UsePriceRange; moneyBoxLower.Text = Search.MinPrice.ToString(); moneyBoxUpper.Text = Search.MaxPrice.ToString(); checkBoxDescriptionSearch.Checked = Search.DescriptionSearch; checkBoxWithBINs.Checked = Search.IncludeAuctionsWithoutBIN; checkBoxPaypal.Checked = Search.OnlyPaypal; checkedListBoxNotifications.SetItemChecked(0, Search.PopupAlert); checkedListBoxNotifications.SetItemChecked(1, Search.SoundAlert); checkedListBoxNotifications.SetItemChecked(2, Search.EmailAlert); if (Search.ExcludeKeywords != null) { listBoxExcludeKeywords.Items.AddRange(Search.ExcludeKeywords.ToArray()); } if (Search.ExcludeSellers != null) { listBoxSellers.Items.AddRange(Search.ExcludeSellers.ToArray()); } checkBoxAutoSearch.Checked = Search.AutoCheck; ShowConditions(Search); }
private SearchType GetSearch() { //save search to disc or send back>??? SearchType ss = new SearchType(); if (textBoxCategory.Tag != null) { ss.Category = ((Categories.Category)textBoxCategory.Tag); } if (checkBoxUsePrices.Checked) { ss.UsePriceRange = true; decimal iop; if (decimal.TryParse(moneyBoxLower.Text.Trim(), out iop)) { ss.MinPrice = iop; } if (decimal.TryParse(moneyBoxUpper.Text.Trim(), out iop)) { ss.MaxPrice = iop; } } ss.Query = textBoxQuery.Text.Trim(); ss.SearchTab = new Tabs.Tab(); //if (!EditMode) //{ //not right - get tag with the current tag of the TAB Tabs.Tab t = (Tabs.Tab)comboTabs.SelectedItem; ss.SearchTab.Name = t.Name.Replace(" ", "_"); //check //} //else //{ // //ues the original name // ss.SearchTab.Name = currentSearchType.SearchTab.Name; //} //if in use then dont change... ss.SearchTab.DisplayName = t.DisplayName; ss.SearchTab.Index = comboTabs.SelectedIndex; ss.DisplayName = textBoxDisplayName.Text; ss.DescriptionSearch = checkBoxDescriptionSearch.Checked; ss.EmailAlert = checkedListBoxNotifications.GetItemChecked(2); ss.IncludeAuctionsWithoutBIN = checkBoxWithBINs.Checked; ss.OnlyPaypal = checkBoxPaypal.Checked; ss.PopupAlert = checkedListBoxNotifications.GetItemChecked(0); ss.SoundAlert = checkedListBoxNotifications.GetItemChecked(1); if (listBoxSellers.Items.Count > 0) { ss.ExcludeSellers = new List <string>(); foreach (string sob in listBoxSellers.Items) { ss.ExcludeSellers.Add(sob); } } if (listBoxExcludeKeywords.Items.Count > 0) { ss.ExcludeKeywords = new List <string>(); foreach (string sob in listBoxExcludeKeywords.Items) { ss.ExcludeKeywords.Add(sob); } } ss.AutoCheck = checkBoxAutoSearch.Checked; if (checkedListBoxConditions.CheckedItems.Count > 0) { ss.Conditions = new List <int>(); foreach (object o in checkedListBoxConditions.CheckedItems) { int co = (int)Enum.Parse(typeof(findItemsAdvanced.ItemFilters.eBayConditionType), o.ToString()); // findItemsAdvancedResponse.Condition con = (findItemsAdvancedResponse.Condition)o; ss.Conditions.Add(co); } } if (txtPostCode.Text.Trim() != "") { ss.Proximity = new findItemsAdvanced.ItemFilters.ProximityType(); ss.Proximity.BuyerPostalCode = txtPostCode.Text.Trim(); ss.Proximity.MaxDistance = (int)numMaxDistance.Value; } return(ss); }